ItSolutionStuff.com

Solved - phpinfo() and php -v shows different version of PHP

By Hardik Savani • May 14, 2024
Ubuntu

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...

Tags: Ubuntu
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Upgrade PHP Version from 7.2 to 7.3 in Ubuntu?

Read Now →

How to Enable Apache mod_rewrite Module in Ubuntu?

Read Now →

Solved - QXcbConnection could not connect to display wkhtmltopdf ubuntu

Read Now →

How to Install Laravel in Ubuntu?

Read Now →

How to Downgrade php 7.4 to 7.3 Ubuntu?

Read Now →

How to create virtual host in ubuntu apache?

Read Now →

How to Install Sublime Text Editor in Ubuntu?

Read Now →

How to Install Sublime Text Editor 3 in Ubuntu?

Read Now →

How to Increase Upload File Size Limit PHP in Ubuntu?

Read Now →

How to Set ANDROID_HOME Environment Variable in Ubuntu?

Read Now →

How to Enable Rewrite Mode for Apache in Ubuntu?

Read Now →