-
Download and extract a release archive to directory of your choice
-
Create a base directory for PHP with the following structure:
%phpDir%/ ├── configurations/ │ ├── 5.x.x.ini # php.ini options for all 5.x.x versions │ ├── 5.3.x.ini # php.ini options for all 5.3.x versions │ ├── 5.3.7.ini # php.ini options specific for 5.3.7 version │ └── ... └── versions/ ├── 5.3.7/ │ ├── ext/ │ ├── ... │ └── php.exe ├── 5.6.0-rc3/ │ ├── ext/ │ ├── ... │ └── php.exe └── ...
-
Create php.ini files in the
configurations
directory. In all php.ini files you can use%phpDir%
variable. This is especially useful forzend_extension
, e.g.zend_extension = "%phpDir%\ext\php_opcache.dll" zend_extension = "%phpDir%\ext\php_xdebug.dll"
-
The active PHP version is always symlinked to
%phpDir%\active
. You may want to add this directory toPATH
. -
Update
phpDir
option inPhpVersionSwitcher.json
to contain path to the base PHP directory.
-
Add Apache service definition under
services
key:{ "services": [ { "label": "Apache 2.4", "name": "Apache2.4" } ] }
-
Update Apache configuration to contain something like this:
LoadModule php5_module "C:/web/php/active/php5apache2_4.dll" PHPIniDir "C:/web/php/active" AddHandler application/x-httpd-php .php
-
You can use
PHP_VERSION_MAJOR
variable in Apache configuration file. This is useful when you switch between PHP 5 and PHP 7 versions:LoadModule php${PHP_VERSION_MAJOR}_module "C:/web/php/active/php${PHP_VERSION_MAJOR}apache2_4.dll"
-
Add Nginx and PHP FastCGI definitions under
executables
key:{ "executables": [ { "label": "Nginx 1.9", "path": "C:\\web\\nginx\\nginx.exe" }, { "label": "PHP FastCGI", "path": "C:\\web\\php\\active\\php-cgi.exe", "multiple": [ {"args": "-b 127.0.0.1:9300", "label": "PHP FastCGI (9300)"}, {"args": "-b 127.0.0.1:9301", "label": "PHP FastCGI (9301)"}, {"args": "-b 127.0.0.1:9302", "label": "PHP FastCGI (9302)"}, {"args": "-b 127.0.0.1:9303", "label": "PHP FastCGI (9303)"}, {"args": "-b 127.0.0.1:9304", "label": "PHP FastCGI (9304)"}, {"args": "-b 127.0.0.1:9305", "label": "PHP FastCGI (9305)"}, {"args": "-b 127.0.0.1:9306", "label": "PHP FastCGI (9306)"}, {"args": "-b 127.0.0.1:9307", "label": "PHP FastCGI (9307)"}, {"args": "-b 127.0.0.1:9308", "label": "PHP FastCGI (9308)"}, {"args": "-b 127.0.0.1:9309", "label": "PHP FastCGI (9309)"} ] }, ] }
-
Update Nginx configuration to contain something like this:
upstream php_farm { server 127.0.0.1:9300 weight=1; server 127.0.0.1:9301 weight=1; server 127.0.0.1:9302 weight=1; server 127.0.0.1:9303 weight=1; server 127.0.0.1:9304 weight=1; server 127.0.0.1:9305 weight=1; server 127.0.0.1:9306 weight=1; server 127.0.0.1:9307 weight=1; server 127.0.0.1:9308 weight=1; server 127.0.0.1:9309 weight=1; } location ~ \.php$ { fastcgi_pass php_farm; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
-
Add definition under
executables
key:{ "executables": [ { "label": "PHP built-in server", "path": "C:\\web\\php\\active\\php.exe", "args": "-S 127.0.0.1:9990 -t C:\\projects" } ] }
The MIT License (MIT)
Copyright (c) 2014 Jan Tvrdík
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Application icon made by Picol, state icons by Freepik from www.flaticon.com, all are modified by Jan Skrasek and licensed under CC BY 3.0.