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...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
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?
- How to Install Sublime Text Editor in Ubuntu?
- 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?