Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Ubuntu PHP Version is different in CLI and in PHPINFO()

Tags:

linux

php

ubuntu

I am very new to linux and setting up PHP in the server.

When I try to do a php -v, the php version is returning a version of 7.0, but when I checked the php version in phpinfo(), it is returning 5.5.9.

My question here is that how can I make both versions to be the same, like when I checked in to the phpinfo(), it should also have 7.0 version.

Your help would be greatly appreciated! Thank you!

like image 392
PinoyStackOverflower Avatar asked Nov 22 '25 09:11

PinoyStackOverflower


1 Answers

First you will need to remove the php by following command. This will remove both i.e php 5 and 7.

sudo apt purge php*

Now install php7.0

sudo apt -y install php7.0 libapache2-mod-php7.0

Then restart Apache:

systemctl restart apache2
like image 123
Aniket Sahrawat Avatar answered Nov 23 '25 23:11

Aniket Sahrawat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!