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
Detecting a Url Using Preg_Match? Without Http:// in the String
Split a Text into Single Words
How to Serve Documents from Outside the Web Root Using PHP
How to Do Aes256 Decryption in PHP
Use Curly Brackets to Structure Code in PHP
PHP Localization Best Practices? Gettext
Output Text File with Line Breaks in PHP
How to Pass a PHP Variable to Vue Component Instance in Laravel Blade
Heredoc Interfering with Code Indentation
How to Run a .Sh File from PHP
Bubble Sort Implementation in PHP
How to Determine a File's True Extension/Type Programmatically
Composer Cannot Download Files
PHP Recursively Unset Array Keys If Match
Pass a Percent (%) Sign in a Url and Get Exact Value of It Using PHP