Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminal always displays wrong php version

Tags:

terminal

php

I have installed php version 5.6.

When I run phpinfo() in browser it displays correct version but in terminal php version 5.3 is shown.

How can I solve this? Due to this problem I am unable to install laravel.

like image 376
Ahmar Arshad Avatar asked Oct 18 '25 01:10

Ahmar Arshad


1 Answers

There are actually two programs:

  • php-cli - what runs when you type php into your terminal
  • mod_php - an apache module which runs PHP as a web server (could also be fast-cgi or another php module)

You need to update your php-cli (contact your web host if you don't control the machine).

like image 200
samlev Avatar answered Oct 19 '25 14:10

samlev