70 likes | 87 Views
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/
E N D
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
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
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
Switch from PHP 5.x to 7.x Run the following command to disable PHP 5.6. $ sudo a2dismod php5.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
Thank You Visit for details https://fedingo.com/how-to-change-php-version-in-ubuntu/