What PHP version am I running (and how do I set it to 7.0)?


#1

A bit of a beginners question I’m afraid, but I see some conflicting information:

  • ee site info example.site shows me PHP version 5.6

  • php -v shows me PHP version 7.0.26-1

  • nano /etc/nginx/sites-available/example.site reads: #include common/php7.conf; include common/w3tc-php7.conf; include common/wpcommon-php7.conf; include common/locations-php7.conf;

So which is it? Can anyone give a hint? :slight_smile:

Warner


#2

So I managed to update to php7 by running: ee site update example.site --php7

After the update, nano /etc/nginx/sites-available/example.site still reads:

include common/w3tc-php7.conf; include common/wpcommon-php7.conf; include common/locations-php7.conf;

So I’m wondering, where is this part of the config set up?

Warner


#3

Hello @warner, all informations are available here : https://easyengine.io/docs/commands/site/update/


#4

common/ is etc/nginx/common/

(I think that’s what you meant)


#5

Well… that’s where the config files are… and if I understand correctly you choose those that are applicable to your setup.

But then I chose include common/w3tc-php7.conf; include common/wpcommon-php7.conf; include common/locations-php7.conf;

…and ee site info example.site still said I was running php5. The thing I don’t get is: where are the settings that determine what version a specific site runs? I.e.: what settings are changed by running ee site update example.site --php7 ?


#6

Yes, easyengine register the new settings when you use the CLI. It’s not possible for EE to detect change on your nginx configuration on the fly.


#7

Basically ee has it’s own internal database. So I believe ‘ee site info’ just reports from that. So if you change anything without using ee commands then ee won’t know about those changes.

But it’s the include files that make stuff happen. So when you create or update a site ee decides which include files to use, and sets these at the site level (i.e. /etc/nginx/sites-available/yoursite.com). ee doesn’t intend you to make any changes ‘manually’.

To prove to yourself what version of php that site is using, you can always just create a phpinfo script in htdocs for that site.

<?php phpinfo();

#8

In such a case, it’d be a good ideia to perform a “services” restart… Have you tried to restart EE with ee stack restart command ? I’ve update to php7 once and while calling php -v an older php version was returned, but restating EE solved it.


#9

php -v is the default command line PHP; it has nothing to do with PHP-FPM process, which runs websites.

Every website may have its own PHP version, independently of command line or other sites.

That’s why @marty’s response is accurate.


#10