2

In my terminal put that command

# php -v

i am getting

PHP 5.6.23-2+deb.sury.org~trusty+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

but in my localhost phpinfo(); i am getting 5.5.9

PHP Version 5.5.9-1ubuntu4.14

how can i got 5.6 in locahost phpinfo(); i am using localhost wamp server in ubundu os..

Balaguru Murugan
  • 463
  • 2
  • 7
  • 21
  • 1
    Wamp provides a range of php versions for you tu use, there usually is no visible difference between some of them, but if you really need to use a specific version, you can try upgrading wamp Or installing the LAMP stack all by yourself, which is easy since you're on ubuntu – RDardelet Jul 13 '16 at 07:07
  • I already updated in ubundu but it will affect only terminal not in localhost – Balaguru Murugan Jul 13 '16 at 07:16

1 Answers1

1

The PHP application and the Apache server will load different php.ini files, wamp provides one in the apache directory and php itself will use the one in it's own php directory (where the apps are located)

To check that, you can do php -i | grep php.ini and compare it to the loaded Configuration File you get from your browser when using phpinfo()

To work around this issue, either install LAMP yourself, or try to link the two files together somehow.

Reference to another Stack Overflow question on the same topic

Community
  • 1
  • 1
RDardelet
  • 564
  • 3
  • 11