Changing a site's PHP version - Pilothouse-App/Pilothouse GitHub Wiki
Pilothouse supports all versions of PHP currently supported by the PHP maintainers. At the time of this writing, that means the available PHP versions in Pilothouse are:
- 5.6
- 7.0
- 7.1
- 7.2
The global default PHP version is 7.0, which will be used if no flags are present, or if no site-specific PHP version is defined. You can change the global default PHP version if you wish.
To override the global default PHP version on a site-by-site basis, define the site's default in the site-specific configuration file.
You can override the site-specific default (or the global default) at any time by including a query arg or cookie in the request. Either set a cookie in the browser named php
containing the desired php version, or add a query argument named php
to the URL, like so:
http://wp.dev/?php=5.6
To can use the bookmarklets below to set a cookie, or run the following code in the console, changing 7.0
to the desired PHP version:
document.cookie='php=7.0;path=/;';
The following bookmarklets can be added to your favorites bar to quickly change the PHP version cookie which will be persistent for the duration of the browser session:
Use PHP 5.6
javascript:(function(){document.cookie='php=5.6;path=/;';})()
Use PHP 7.0
javascript:(function(){document.cookie='php=7.0;path=/;';})()
Use PHP 7.1
javascript:(function(){document.cookie='php=7.1;path=/;';})()
Use PHP 7.2
javascript:(function(){document.cookie='php=7.2;path=/;';})()
In summary, the process for determining which PHP version is used for a request uses the following hierarchy:
- Query arg, if present
- Cookie, if present
- Site-specific default, if present
- Global default