Question

php -v is 7.0.11 and phpinfo() is 5.5.9

I have updated php to 7.0. php -v return 7.0.11. But phpinfo() return 5.5.9.

Can anyone help me?

Subscribe
Share

Can you tell me some advice or give some links about this problem?

Sounds like you’ve upgraded the CLI version of PHP but not what Apache uses.

I have lamp stack and I have update php according to this topic:

[https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04]

php -v returns 7.0.11, but phpinfo() has different result 5.5.9.

You’d need to tell us at least one thing about your environment or what you did so far. We have no idea how you upgraded PHP.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Did you switched PHP modules on Apache? You should first disable PHP5.6 module then enable PHP7 module and restart Apache. To disable PHP5.6 on Apache execute :

  1. sudo a2dismod php5.6

Now you should enable PHP7 ones:

  1. sudo a2enmod php7.0

To reflect changes Apache restart is required:

  1. sudo systemctl restart apache2

Try again phpinfo, and report is it or we need to try something other. :) Edit: try with php5.5 if php5.6 returns not exist module, I noticed it late :P

Did you switched PHP modules on Apache? You should first disable PHP5.6 module then enable PHP7 module and restart Apache. To disable PHP5.6 on Apache execute :

  1. sudo a2dismod php5.6

Now you should enable PHP7 ones:

  1. sudo a2enmod php7.0

To reflect changes Apache restart is required:

  1. sudo systemctl restart apache2

Try again phpinfo, and report is it or we need to try something other. :) Edit: try with php5.5 if php5.6 returns not exist module, I noticed it late :P