1 / 7

How to Change PHP Version Ubuntu

Sometimes you may need to change PHP version in Ubuntu. Here are the steps to do it in Linux.<br><br>Visit https://fedingo.com/how-to-change-php-version-in-ubuntu/

Download Presentation

How to Change PHP Version Ubuntu

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Change PHP Version in Ubuntu

  2. Switch from PHP 7.x to 5.x - Disable PHP 7.x Open terminal and run the following command to disable PHP 7.2. $ sudo a2dismod php7.2 You will see the following output. Module php7.2 disabled. To activate the new configuration, you need to run: systemctl restart apache2

  3. Enable PHP 5.6 Enable PHP 5.6. $ sudo a2enmod php5.6 Run the following command to set PHP 5.6 as default version. $ sudo update-alternatives --set php /usr/bin/php5.6

  4. Reset PHP Packages If you have installed other packages as well, set them as default with the following command. Here is an example to set default version of phar package. $ sudo update-alternatives --set phar /usr/bin/phar5.6 Restart your Apache server to apply changes. Check if PHP version is updated or not. $ php -v

  5. Switch from PHP 5.x to 7.x Run the following command to disable PHP 5.6. $ sudo a2dismod php5.6

  6. Enable PHP 7.2 Run the following command to enable PHP 7.2. $ sudo a2enmod php7.2 Set default PHP version to 7.2. $ sudo update-alternatives --set php /usr/bin/php7.2 Restart Apache server. $ sudo systemctl restart apache2

  7. Thank You Visit for details https://fedingo.com/how-to-change-php-version-in-ubuntu/

More Related