Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, ApacheWhat is the best Linux distro for a php web server?Loading...

What wound would be of little consequence to a biped but terrible for a quadruped?

Is going from continuous data to categorical always wrong?

What is the likely impact on flights of grounding an entire aircraft series?

What to do when during a meeting client people start to fight (even physically) with each others?

Why doesn't the EU now just force the UK to choose between referendum and no-deal?

What exactly is the purpose of connection links straped between the rocket and the launch pad

My adviser wants to be the first author

Best approach to update all entries in a list that is paginated?

Replacing Windows 7 security updates with anti-virus?

Life insurance that covers only simultaneous/dual deaths

"However" used in a conditional clause?

Ban on all campaign finance?

Is it true that real estate prices mainly go up?

If the Captain's screens are out, does he switch seats with the co-pilot?

Making a sword in the stone, in a medieval world without magic

Can infringement of a trademark be pursued for using a company's name in a sentence?

What has been your most complicated TikZ drawing?

How does Dispel Magic work against Stoneskin?

How could a female member of a species produce eggs unto death?

Is a lawful good "antagonist" effective?

Provisioning profile doesn't include the application-identifier and keychain-access-groups entitlements

When were linguistics departments first established

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit?



Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, Apache


What is the best Linux distro for a php web server?Loading JSON in PHP53: ZVAL_DELREF in Unknown on line 0Wrong version of PHP is used when called from a scriptUpgrade from PHP 7.0 to 7.1 on Ubuntu 16.04 not workingLimit fastcgi (php-cgi) process time on Ubuntu 16.04using apt-clone on fresh ubuntu 16.04 installs php 7.0Cant install php-zip on Ubuntu 16.04 serverswitch apache from prefork to event in Ubuntu 16, get php 7 workingPHP.ini custom session.save_path Permission deniedPHP 7.2 - Apache 2.4 memory limit issue













18















I need to downgrade PHP on one of my VMs from 7.2 to 7.1 on Ubuntu 16.0.4. The last time I tried to remove just PHP and replace it with a different version, I had all kinds of issues with Apache and MySQL. Is there a quick way to downgrade PHP from 7.2 to 7.1 without having to fully reinstall and configure Apache (latest version as of this writing) and everything else on the server?



I have to downgrade due to bad information I received from a software vendor that claims their application runs on PHP 7.2. Turns out it must have 7.1.



I tried looking for info about how to downgrade from 7.2 to 7.1, but only get 'upgrade' results.



Thank you for your help.










share|improve this question


















  • 1





    How did you get PHP 7.2 to begin with?

    – Michael Hampton
    Feb 5 '18 at 17:31











  • Update: I used sudo add-apt-repository ppa:ondrej/php to install PHP 7.2.x

    – Pegues
    Feb 5 '18 at 17:33











  • Amazing that there have been no answers about this. This would seem to be a relatively easy thing to solve for a seasoned system administrator. I'll post an answer to what I did.

    – Pegues
    Feb 6 '18 at 15:16
















18















I need to downgrade PHP on one of my VMs from 7.2 to 7.1 on Ubuntu 16.0.4. The last time I tried to remove just PHP and replace it with a different version, I had all kinds of issues with Apache and MySQL. Is there a quick way to downgrade PHP from 7.2 to 7.1 without having to fully reinstall and configure Apache (latest version as of this writing) and everything else on the server?



I have to downgrade due to bad information I received from a software vendor that claims their application runs on PHP 7.2. Turns out it must have 7.1.



I tried looking for info about how to downgrade from 7.2 to 7.1, but only get 'upgrade' results.



Thank you for your help.










share|improve this question


















  • 1





    How did you get PHP 7.2 to begin with?

    – Michael Hampton
    Feb 5 '18 at 17:31











  • Update: I used sudo add-apt-repository ppa:ondrej/php to install PHP 7.2.x

    – Pegues
    Feb 5 '18 at 17:33











  • Amazing that there have been no answers about this. This would seem to be a relatively easy thing to solve for a seasoned system administrator. I'll post an answer to what I did.

    – Pegues
    Feb 6 '18 at 15:16














18












18








18


9






I need to downgrade PHP on one of my VMs from 7.2 to 7.1 on Ubuntu 16.0.4. The last time I tried to remove just PHP and replace it with a different version, I had all kinds of issues with Apache and MySQL. Is there a quick way to downgrade PHP from 7.2 to 7.1 without having to fully reinstall and configure Apache (latest version as of this writing) and everything else on the server?



I have to downgrade due to bad information I received from a software vendor that claims their application runs on PHP 7.2. Turns out it must have 7.1.



I tried looking for info about how to downgrade from 7.2 to 7.1, but only get 'upgrade' results.



Thank you for your help.










share|improve this question














I need to downgrade PHP on one of my VMs from 7.2 to 7.1 on Ubuntu 16.0.4. The last time I tried to remove just PHP and replace it with a different version, I had all kinds of issues with Apache and MySQL. Is there a quick way to downgrade PHP from 7.2 to 7.1 without having to fully reinstall and configure Apache (latest version as of this writing) and everything else on the server?



I have to downgrade due to bad information I received from a software vendor that claims their application runs on PHP 7.2. Turns out it must have 7.1.



I tried looking for info about how to downgrade from 7.2 to 7.1, but only get 'upgrade' results.



Thank you for your help.







php apache-2.4 ubuntu-16.04 php7






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 5 '18 at 17:28









PeguesPegues

471149




471149








  • 1





    How did you get PHP 7.2 to begin with?

    – Michael Hampton
    Feb 5 '18 at 17:31











  • Update: I used sudo add-apt-repository ppa:ondrej/php to install PHP 7.2.x

    – Pegues
    Feb 5 '18 at 17:33











  • Amazing that there have been no answers about this. This would seem to be a relatively easy thing to solve for a seasoned system administrator. I'll post an answer to what I did.

    – Pegues
    Feb 6 '18 at 15:16














  • 1





    How did you get PHP 7.2 to begin with?

    – Michael Hampton
    Feb 5 '18 at 17:31











  • Update: I used sudo add-apt-repository ppa:ondrej/php to install PHP 7.2.x

    – Pegues
    Feb 5 '18 at 17:33











  • Amazing that there have been no answers about this. This would seem to be a relatively easy thing to solve for a seasoned system administrator. I'll post an answer to what I did.

    – Pegues
    Feb 6 '18 at 15:16








1




1





How did you get PHP 7.2 to begin with?

– Michael Hampton
Feb 5 '18 at 17:31





How did you get PHP 7.2 to begin with?

– Michael Hampton
Feb 5 '18 at 17:31













Update: I used sudo add-apt-repository ppa:ondrej/php to install PHP 7.2.x

– Pegues
Feb 5 '18 at 17:33





Update: I used sudo add-apt-repository ppa:ondrej/php to install PHP 7.2.x

– Pegues
Feb 5 '18 at 17:33













Amazing that there have been no answers about this. This would seem to be a relatively easy thing to solve for a seasoned system administrator. I'll post an answer to what I did.

– Pegues
Feb 6 '18 at 15:16





Amazing that there have been no answers about this. This would seem to be a relatively easy thing to solve for a seasoned system administrator. I'll post an answer to what I did.

– Pegues
Feb 6 '18 at 15:16










4 Answers
4






active

oldest

votes


















28














Below is a description of what I did. I hope this information can help someone else:



I installed PHP 7.1 along side PHP 7.2. I also installed most of the needed extensions for PHP 7.1. I then did a2dismod php7.2 and a2enmod php7.1 so that I could switch over to PHP 7.1 while keeping 7.2 still installed on the server. Most of my sites work after making the switch. The only site that doesn't seem to be working is a Joomla site. The full list of commands I ran are below:



sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt-get install php7.1

sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

sudo a2dismod php7.2

sudo a2enmod php7.1

sudo service apache2 restart





share|improve this answer





















  • 1





    I am also in the same situation but even after disabling 7.2 module, if I type php -v, it still shows php7.2. Any idea?

    – khichar.anil
    Apr 3 '18 at 23:52






  • 1





    I too have the same thing. Even though PHP 7.1 is currently enabled on my server, typing php -v shows PHP 7.2.2. However, if I load phpinfo() in my browser, it will show the correct version, 7.1.13. Have you tried reviewing a file with phpinfo() ?

    – Pegues
    Apr 4 '18 at 0:17













  • See my comment below. It will change the default php path.

    – khichar.anil
    Apr 4 '18 at 1:30






  • 1





    A helpful article tecadmin.net/switch-between-multiple-php-version-on-ubuntu

    – CrandellWS
    Apr 28 '18 at 17:57











  • @CrandellWS thanks for the share. Certainly helpful information.

    – Pegues
    Apr 30 '18 at 12:44



















13














for display enabled php version in terminal by php -v. we need to set update cli version of php.
use below command to update php cli version



// change terminal (cli) version (7.2 to 7.1)
sudo update-alternatives --set php /usr/bin/php7.1





share|improve this answer































    12














    @pegues:
    Your above mentioned method worked well for apache to switch the different version. By running following commands will change the php from terminal as well. Actually you just need to change the symlink to the desired PHP version.



    sudo rm /usr/bin/php

    sudo ln -s /usr/bin/php7.1 /usr/bin/php





    share|improve this answer































      0














      This is what I did:



      sudo add-apt-repository ppa:ondrej/php

      sudo apt-get update

      sudo apt-get install php7.1

      sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

      sudo rm /usr/bin/php

      sudo ln -s /usr/bin/php7.1 /usr/bin/php


      And to confirm that you have the php 7.1 type the following command



      php --ini |grep Loaded


      it should return the following response



      Loaded Configuration File:         /etc/php/7.1/cli/php.ini


      if you are using laravel for some reason then modify your fpm.service to point to the 7.1 version and then restart it as well



      sudo systemctl restart php7.1-fpm.service

      sudo service nginx restart





      share|improve this answer








      New contributor




      Miguel Trevino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "2"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f895746%2fswitch-from-php-7-2-to-7-1-on-ubuntu-16-04-apache%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        28














        Below is a description of what I did. I hope this information can help someone else:



        I installed PHP 7.1 along side PHP 7.2. I also installed most of the needed extensions for PHP 7.1. I then did a2dismod php7.2 and a2enmod php7.1 so that I could switch over to PHP 7.1 while keeping 7.2 still installed on the server. Most of my sites work after making the switch. The only site that doesn't seem to be working is a Joomla site. The full list of commands I ran are below:



        sudo add-apt-repository ppa:ondrej/php

        sudo apt-get update

        sudo apt-get install php7.1

        sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

        sudo a2dismod php7.2

        sudo a2enmod php7.1

        sudo service apache2 restart





        share|improve this answer





















        • 1





          I am also in the same situation but even after disabling 7.2 module, if I type php -v, it still shows php7.2. Any idea?

          – khichar.anil
          Apr 3 '18 at 23:52






        • 1





          I too have the same thing. Even though PHP 7.1 is currently enabled on my server, typing php -v shows PHP 7.2.2. However, if I load phpinfo() in my browser, it will show the correct version, 7.1.13. Have you tried reviewing a file with phpinfo() ?

          – Pegues
          Apr 4 '18 at 0:17













        • See my comment below. It will change the default php path.

          – khichar.anil
          Apr 4 '18 at 1:30






        • 1





          A helpful article tecadmin.net/switch-between-multiple-php-version-on-ubuntu

          – CrandellWS
          Apr 28 '18 at 17:57











        • @CrandellWS thanks for the share. Certainly helpful information.

          – Pegues
          Apr 30 '18 at 12:44
















        28














        Below is a description of what I did. I hope this information can help someone else:



        I installed PHP 7.1 along side PHP 7.2. I also installed most of the needed extensions for PHP 7.1. I then did a2dismod php7.2 and a2enmod php7.1 so that I could switch over to PHP 7.1 while keeping 7.2 still installed on the server. Most of my sites work after making the switch. The only site that doesn't seem to be working is a Joomla site. The full list of commands I ran are below:



        sudo add-apt-repository ppa:ondrej/php

        sudo apt-get update

        sudo apt-get install php7.1

        sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

        sudo a2dismod php7.2

        sudo a2enmod php7.1

        sudo service apache2 restart





        share|improve this answer





















        • 1





          I am also in the same situation but even after disabling 7.2 module, if I type php -v, it still shows php7.2. Any idea?

          – khichar.anil
          Apr 3 '18 at 23:52






        • 1





          I too have the same thing. Even though PHP 7.1 is currently enabled on my server, typing php -v shows PHP 7.2.2. However, if I load phpinfo() in my browser, it will show the correct version, 7.1.13. Have you tried reviewing a file with phpinfo() ?

          – Pegues
          Apr 4 '18 at 0:17













        • See my comment below. It will change the default php path.

          – khichar.anil
          Apr 4 '18 at 1:30






        • 1





          A helpful article tecadmin.net/switch-between-multiple-php-version-on-ubuntu

          – CrandellWS
          Apr 28 '18 at 17:57











        • @CrandellWS thanks for the share. Certainly helpful information.

          – Pegues
          Apr 30 '18 at 12:44














        28












        28








        28







        Below is a description of what I did. I hope this information can help someone else:



        I installed PHP 7.1 along side PHP 7.2. I also installed most of the needed extensions for PHP 7.1. I then did a2dismod php7.2 and a2enmod php7.1 so that I could switch over to PHP 7.1 while keeping 7.2 still installed on the server. Most of my sites work after making the switch. The only site that doesn't seem to be working is a Joomla site. The full list of commands I ran are below:



        sudo add-apt-repository ppa:ondrej/php

        sudo apt-get update

        sudo apt-get install php7.1

        sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

        sudo a2dismod php7.2

        sudo a2enmod php7.1

        sudo service apache2 restart





        share|improve this answer















        Below is a description of what I did. I hope this information can help someone else:



        I installed PHP 7.1 along side PHP 7.2. I also installed most of the needed extensions for PHP 7.1. I then did a2dismod php7.2 and a2enmod php7.1 so that I could switch over to PHP 7.1 while keeping 7.2 still installed on the server. Most of my sites work after making the switch. The only site that doesn't seem to be working is a Joomla site. The full list of commands I ran are below:



        sudo add-apt-repository ppa:ondrej/php

        sudo apt-get update

        sudo apt-get install php7.1

        sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

        sudo a2dismod php7.2

        sudo a2enmod php7.1

        sudo service apache2 restart






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 29 '18 at 3:35









        aphoe

        1033




        1033










        answered Feb 6 '18 at 15:15









        PeguesPegues

        471149




        471149








        • 1





          I am also in the same situation but even after disabling 7.2 module, if I type php -v, it still shows php7.2. Any idea?

          – khichar.anil
          Apr 3 '18 at 23:52






        • 1





          I too have the same thing. Even though PHP 7.1 is currently enabled on my server, typing php -v shows PHP 7.2.2. However, if I load phpinfo() in my browser, it will show the correct version, 7.1.13. Have you tried reviewing a file with phpinfo() ?

          – Pegues
          Apr 4 '18 at 0:17













        • See my comment below. It will change the default php path.

          – khichar.anil
          Apr 4 '18 at 1:30






        • 1





          A helpful article tecadmin.net/switch-between-multiple-php-version-on-ubuntu

          – CrandellWS
          Apr 28 '18 at 17:57











        • @CrandellWS thanks for the share. Certainly helpful information.

          – Pegues
          Apr 30 '18 at 12:44














        • 1





          I am also in the same situation but even after disabling 7.2 module, if I type php -v, it still shows php7.2. Any idea?

          – khichar.anil
          Apr 3 '18 at 23:52






        • 1





          I too have the same thing. Even though PHP 7.1 is currently enabled on my server, typing php -v shows PHP 7.2.2. However, if I load phpinfo() in my browser, it will show the correct version, 7.1.13. Have you tried reviewing a file with phpinfo() ?

          – Pegues
          Apr 4 '18 at 0:17













        • See my comment below. It will change the default php path.

          – khichar.anil
          Apr 4 '18 at 1:30






        • 1





          A helpful article tecadmin.net/switch-between-multiple-php-version-on-ubuntu

          – CrandellWS
          Apr 28 '18 at 17:57











        • @CrandellWS thanks for the share. Certainly helpful information.

          – Pegues
          Apr 30 '18 at 12:44








        1




        1





        I am also in the same situation but even after disabling 7.2 module, if I type php -v, it still shows php7.2. Any idea?

        – khichar.anil
        Apr 3 '18 at 23:52





        I am also in the same situation but even after disabling 7.2 module, if I type php -v, it still shows php7.2. Any idea?

        – khichar.anil
        Apr 3 '18 at 23:52




        1




        1





        I too have the same thing. Even though PHP 7.1 is currently enabled on my server, typing php -v shows PHP 7.2.2. However, if I load phpinfo() in my browser, it will show the correct version, 7.1.13. Have you tried reviewing a file with phpinfo() ?

        – Pegues
        Apr 4 '18 at 0:17







        I too have the same thing. Even though PHP 7.1 is currently enabled on my server, typing php -v shows PHP 7.2.2. However, if I load phpinfo() in my browser, it will show the correct version, 7.1.13. Have you tried reviewing a file with phpinfo() ?

        – Pegues
        Apr 4 '18 at 0:17















        See my comment below. It will change the default php path.

        – khichar.anil
        Apr 4 '18 at 1:30





        See my comment below. It will change the default php path.

        – khichar.anil
        Apr 4 '18 at 1:30




        1




        1





        A helpful article tecadmin.net/switch-between-multiple-php-version-on-ubuntu

        – CrandellWS
        Apr 28 '18 at 17:57





        A helpful article tecadmin.net/switch-between-multiple-php-version-on-ubuntu

        – CrandellWS
        Apr 28 '18 at 17:57













        @CrandellWS thanks for the share. Certainly helpful information.

        – Pegues
        Apr 30 '18 at 12:44





        @CrandellWS thanks for the share. Certainly helpful information.

        – Pegues
        Apr 30 '18 at 12:44













        13














        for display enabled php version in terminal by php -v. we need to set update cli version of php.
        use below command to update php cli version



        // change terminal (cli) version (7.2 to 7.1)
        sudo update-alternatives --set php /usr/bin/php7.1





        share|improve this answer




























          13














          for display enabled php version in terminal by php -v. we need to set update cli version of php.
          use below command to update php cli version



          // change terminal (cli) version (7.2 to 7.1)
          sudo update-alternatives --set php /usr/bin/php7.1





          share|improve this answer


























            13












            13








            13







            for display enabled php version in terminal by php -v. we need to set update cli version of php.
            use below command to update php cli version



            // change terminal (cli) version (7.2 to 7.1)
            sudo update-alternatives --set php /usr/bin/php7.1





            share|improve this answer













            for display enabled php version in terminal by php -v. we need to set update cli version of php.
            use below command to update php cli version



            // change terminal (cli) version (7.2 to 7.1)
            sudo update-alternatives --set php /usr/bin/php7.1






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 2 '18 at 4:28









            Chirag GotiChirag Goti

            13112




            13112























                12














                @pegues:
                Your above mentioned method worked well for apache to switch the different version. By running following commands will change the php from terminal as well. Actually you just need to change the symlink to the desired PHP version.



                sudo rm /usr/bin/php

                sudo ln -s /usr/bin/php7.1 /usr/bin/php





                share|improve this answer




























                  12














                  @pegues:
                  Your above mentioned method worked well for apache to switch the different version. By running following commands will change the php from terminal as well. Actually you just need to change the symlink to the desired PHP version.



                  sudo rm /usr/bin/php

                  sudo ln -s /usr/bin/php7.1 /usr/bin/php





                  share|improve this answer


























                    12












                    12








                    12







                    @pegues:
                    Your above mentioned method worked well for apache to switch the different version. By running following commands will change the php from terminal as well. Actually you just need to change the symlink to the desired PHP version.



                    sudo rm /usr/bin/php

                    sudo ln -s /usr/bin/php7.1 /usr/bin/php





                    share|improve this answer













                    @pegues:
                    Your above mentioned method worked well for apache to switch the different version. By running following commands will change the php from terminal as well. Actually you just need to change the symlink to the desired PHP version.



                    sudo rm /usr/bin/php

                    sudo ln -s /usr/bin/php7.1 /usr/bin/php






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Apr 4 '18 at 1:29









                    khichar.anilkhichar.anil

                    22114




                    22114























                        0














                        This is what I did:



                        sudo add-apt-repository ppa:ondrej/php

                        sudo apt-get update

                        sudo apt-get install php7.1

                        sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

                        sudo rm /usr/bin/php

                        sudo ln -s /usr/bin/php7.1 /usr/bin/php


                        And to confirm that you have the php 7.1 type the following command



                        php --ini |grep Loaded


                        it should return the following response



                        Loaded Configuration File:         /etc/php/7.1/cli/php.ini


                        if you are using laravel for some reason then modify your fpm.service to point to the 7.1 version and then restart it as well



                        sudo systemctl restart php7.1-fpm.service

                        sudo service nginx restart





                        share|improve this answer








                        New contributor




                        Miguel Trevino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.

























                          0














                          This is what I did:



                          sudo add-apt-repository ppa:ondrej/php

                          sudo apt-get update

                          sudo apt-get install php7.1

                          sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

                          sudo rm /usr/bin/php

                          sudo ln -s /usr/bin/php7.1 /usr/bin/php


                          And to confirm that you have the php 7.1 type the following command



                          php --ini |grep Loaded


                          it should return the following response



                          Loaded Configuration File:         /etc/php/7.1/cli/php.ini


                          if you are using laravel for some reason then modify your fpm.service to point to the 7.1 version and then restart it as well



                          sudo systemctl restart php7.1-fpm.service

                          sudo service nginx restart





                          share|improve this answer








                          New contributor




                          Miguel Trevino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.























                            0












                            0








                            0







                            This is what I did:



                            sudo add-apt-repository ppa:ondrej/php

                            sudo apt-get update

                            sudo apt-get install php7.1

                            sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

                            sudo rm /usr/bin/php

                            sudo ln -s /usr/bin/php7.1 /usr/bin/php


                            And to confirm that you have the php 7.1 type the following command



                            php --ini |grep Loaded


                            it should return the following response



                            Loaded Configuration File:         /etc/php/7.1/cli/php.ini


                            if you are using laravel for some reason then modify your fpm.service to point to the 7.1 version and then restart it as well



                            sudo systemctl restart php7.1-fpm.service

                            sudo service nginx restart





                            share|improve this answer








                            New contributor




                            Miguel Trevino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.










                            This is what I did:



                            sudo add-apt-repository ppa:ondrej/php

                            sudo apt-get update

                            sudo apt-get install php7.1

                            sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

                            sudo rm /usr/bin/php

                            sudo ln -s /usr/bin/php7.1 /usr/bin/php


                            And to confirm that you have the php 7.1 type the following command



                            php --ini |grep Loaded


                            it should return the following response



                            Loaded Configuration File:         /etc/php/7.1/cli/php.ini


                            if you are using laravel for some reason then modify your fpm.service to point to the 7.1 version and then restart it as well



                            sudo systemctl restart php7.1-fpm.service

                            sudo service nginx restart






                            share|improve this answer








                            New contributor




                            Miguel Trevino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            share|improve this answer



                            share|improve this answer






                            New contributor




                            Miguel Trevino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            answered 12 mins ago









                            Miguel TrevinoMiguel Trevino

                            1




                            1




                            New contributor




                            Miguel Trevino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.





                            New contributor





                            Miguel Trevino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.






                            Miguel Trevino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Server Fault!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f895746%2fswitch-from-php-7-2-to-7-1-on-ubuntu-16-04-apache%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

                                Список ссавців Італії Природоохоронні статуси | Список |...

                                Українські прізвища Зміст Історичні відомості |...