I am new to using Linux and I broke some php settings while tampering.
If I execute a php script containing: phpinfo();
it shows the php versions as 5.6, but via the command line, if I run php -v
it returns a version of 7.0.
I want to have both versions match.
How can i fix my command line PATH to also use php 5.6?
You can do sudo update-alternatives --config php to set which system wide version of PHP you want to use. This makes your command line and apache versions work the same. You can read more about update-alternatives on the man page.
Open a bash shell terminal and use the command “php –version” or “php -v” to get the version of PHP installed on the system. As you can see from both the command output above, the system has PHP 5.4. 16 installed.
sudo update-alternatives --set php /usr/bin/php5.6
Please see: Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With