How to Change PHP-Cli Version on Ubuntu 14.04

How can I change php-cli version on Ubuntu 14.04?

sudo update-alternatives --set php /usr/bin/php5.6

Please see: Source

Choose php version on Ubuntu 14.04 (php vs php5)

Finally solved it. Installed php version manager "phpbrew" and it allows you to have differents versions of php and it also allows you to manage extensions.

Change my PHP version on my Ubuntu server

Your CLI is referenced to PHP-CLI binaries. But Apache uses its internal module (libapache2-mod-php) to process PHP scripts. You have to downgrade the version of libapache2-mod-php.

Try with below commands

# Install the old version of libapache-php
sudo apt-get install libapache2-mod-php5

# Disable PHP 5.6 module
sudo a2dismod php5.6

# Enable php 5.3 module
sudo a2enmod php5

# Restart Apache
sudo service apache2 restart

Multiple php versions - how to update php version in Wordpress settings

After updating the php to version 7.3, you should enable that mode in apache configuration.

Run this command:

sudo a2enmod php7.3

Is it Possible to use more than one PHP Version in Ubuntu?

Yes, you can.
Please try to install like

$ sudo apt install php5.6 
$ sudo apt install php7.0

Here php5.6 and php7.0 is PHP version



Related Topics



Leave a reply



Submit