Ubuntu: php -v showing 5.4 and phpinfo show 5.6


I am trying to install laravel that need > 5.5php version. My current php is of version 5.6, but composer detect version 5.4 and gives error.

How to remove php 5.4 or make the correct version for php -v. Any help will be appreciated.


You tagged that you're using XAMPP, which doesn't actually install PHP to your system. The version inside XAMPP may be php 5.6, but the version installed to your system is different.

Since you're on 12.04, I don't think you can install php 5.6 from the standard repos using apt-get.

You have two options:

1) Install php 5.6 manually. This is the best way, but it may be difficult for a first timer. You will also need to install apache 2.4, as PHP 5.6 is not compatible with the version in 12.04 (I think): http://php.net/manual/en/install.unix.apache2.php

2) Install PHP 5.6 from a 3rd party repository. This is risky, as you are adding an unverified (but popular) repository to your apt sources. It will also be the most simple way, though: https://joshtronic.com/2014/09/14/upgrade-php-53-to-php-56-on-ubuntu-1204-lts/

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »