Solved - phpinfo() and php -v shows different version of PHP
In this tute, we will discuss phpinfo() and php shows different version of php. if you want to see example of php version different phpinfo then you are a right place. we will help you to give example of phpinfo showing different version. step by step explain php -v shows different version.
Few days ago i upgrade my php version 7.3 to 7.4 in ubuntu system. it's installed everything well with php 7.4 but when i try to rum "php -v" command then it still shows old version of php.
after google search i found solution how to resolve it. you have to run update-alternatives command choose current version from list.
Let's run bellow command:
sudo update-alternatives --config php
now there will be a list of installed php cli, choose what you want to keep. as like bellow screen shot:
now run bellow command to restart:
sudo service apache2 restart
I hope it can help you...
We are Recommending you
- How to Upgrade PHP Version from 7.2 to 7.3 in Ubuntu?
- How to Enable Apache mod_rewrite Module in Ubuntu?
- Solved - QXcbConnection could not connect to display wkhtmltopdf ubuntu
- How to Install Laravel in Ubuntu?
- How to Downgrade php 7.4 to 7.3 Ubuntu?
- How to create virtual host in ubuntu apache?
- Install Sublime Text 3 in Ubuntu 14.04 using Terminal
- How to Install Sublime Text Editor 3 in Ubuntu?
- How to increase upload file size limit PHP in Ubuntu?
- How to set ANDROID_HOME environment variable in ubuntu?
- How to enable rewrite mode for apache in ubuntu?