|
PHP Version Switching
|
The Uniform Server Zero XII provides switching between PHP versions 5.3, 5.4, 5.5, 5.6 and 7.0 to achieve this you need to download a suitable PHP plugin for each version (for example ZeroXII_php_5_3_29.exe, ZeroXII_php_5_4_45.exe, ZeroXII_php_5_5_30.exe, ZeroXII_php_5_6_16.exe, and ZeroXII_php_7_0_0.exe) explained below.
Note: PHP Net decided to skip PHP version 6.0
Switching overview
PHP Switching
In order to switch between PHP versions environoment variable PHP_SELECT is set to the selected PHP version. Valid values are php53, php54, php55, php56 and php70.
To ensure correct PHP configuration file is used environoment variable PHP_INI_SELECT is set to the selected PHP configuration file. Valid values are php_test.ini, php_development.ini and php_production.ini.
The PHP_SELECT environment variable is used in the Apache configuration file httpd.conf to select the appropriate configuration block. Within the selected block environment variable PHP_INI_SELECT selects the configuration file to use.
The Apache configuration code for PHP switching is shown on the right.
PHP Plugins
Related to PHP switching, when installing a plugin for an existing PHP series (PHP 53, 54, 55, 56 or 70) it is assumed you want to use it instead of the one currently installed. This allows you to revert back to an older version number within the same PHP series.
|
Apache configuration file: UniServerZ\core\apache2\conf\httpd.conf
# Environment variable ${PHP_SELECT} has a value of
# php53, php54, php55 or php56. It is used in the following
# five define statements to select a PHP version to
# load as a module.
Define ${PHP_SELECT}
<IfDefine php53>
LoadFile ${US_ROOTF}/core/php53/libsasl.dll
LoadFile ${US_ROOTF}/core/php53/icudt55.dll
LoadFile ${US_ROOTF}/core/php53/icuin55.dll
LoadFile ${US_ROOTF}/core/php53/icuio55.dll
LoadFile ${US_ROOTF}/core/php53/icule55.dll
LoadFile ${US_ROOTF}/core/php53/iculx55.dll
LoadFile ${US_ROOTF}/core/php53/icutu55.dll
LoadFile ${US_ROOTF}/core/php53/icuuc55.dll
# Load PHP module and add handler
LoadModule php5_module "${US_ROOTF}/core/php53/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# Configure the path to php.ini
PHPIniDir "${US_ROOTF}/core/php53/${PHP_INI_SELECT}"
</IfDefine>
<IfDefine php54>
LoadFile ${US_ROOTF}/core/php54/libsasl.dll
LoadFile ${US_ROOTF}/core/php54/icudt55.dll
LoadFile ${US_ROOTF}/core/php54/icuin55.dll
LoadFile ${US_ROOTF}/core/php54/icuio55.dll
LoadFile ${US_ROOTF}/core/php54/icule55.dll
LoadFile ${US_ROOTF}/core/php54/iculx55.dll
LoadFile ${US_ROOTF}/core/php54/icutu55.dll
LoadFile ${US_ROOTF}/core/php54/icuuc55.dll
# Load PHP module and add handler
LoadModule php5_module "${US_ROOTF}/core/php54/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# Configure the path to php.ini
PHPIniDir "${US_ROOTF}/core/php54/${PHP_INI_SELECT}"
</IfDefine>
<IfDefine php55>
LoadFile ${US_ROOTF}/core/php55/libsasl.dll
LoadFile ${US_ROOTF}/core/php55/icudt55.dll
LoadFile ${US_ROOTF}/core/php55/icuin55.dll
LoadFile ${US_ROOTF}/core/php55/icuio55.dll
LoadFile ${US_ROOTF}/core/php55/icule55.dll
LoadFile ${US_ROOTF}/core/php55/iculx55.dll
LoadFile ${US_ROOTF}/core/php55/icutu55.dll
LoadFile ${US_ROOTF}/core/php55/icuuc55.dll
# Load PHP module and add handler
LoadModule php5_module "${US_ROOTF}/core/php55/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# Configure the path to php.ini
PHPIniDir "${US_ROOTF}/core/php55/${PHP_INI_SELECT}"
</IfDefine>
<IfDefine php56>
LoadFile ${US_ROOTF}/core/php56/libsasl.dll
LoadFile ${US_ROOTF}/core/php56/icudt55.dll
LoadFile ${US_ROOTF}/core/php56/icuin55.dll
LoadFile ${US_ROOTF}/core/php56/icuio55.dll
LoadFile ${US_ROOTF}/core/php56/icule55.dll
LoadFile ${US_ROOTF}/core/php56/iculx55.dll
LoadFile ${US_ROOTF}/core/php56/icutu55.dll
LoadFile ${US_ROOTF}/core/php56/icuuc55.dll
# Load PHP module and add handler
LoadModule php5_module "${US_ROOTF}/core/php56/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# Configure the path to php.ini
PHPIniDir "${US_ROOTF}/core/php56/${PHP_INI_SELECT}"
</IfDefine>
<IfDefine php70>
LoadFile ${US_ROOTF}/core/php70/libsasl.dll
LoadFile ${US_ROOTF}/core/php70/icudt56.dll
LoadFile ${US_ROOTF}/core/php70/icuin56.dll
LoadFile ${US_ROOTF}/core/php70/icuio56.dll
LoadFile ${US_ROOTF}/core/php70/icule56.dll
LoadFile ${US_ROOTF}/core/php70/icuuc56.dll
# Load PHP module and add handler
LoadModule php7_module "${US_ROOTF}/core/php70/php7apache2_4.dll"
AddHandler application/x-httpd-php .php
# Configure the path to php.ini
PHPIniDir "${US_ROOTF}/core/php70/${PHP_INI_SELECT}"
</IfDefine>
|
UniController PHP Switching
PHP Switching
- Click version you wish to use A), B), C), D) or E).
- Previous selection is deselected and new selection enabled.
- Selected PHP version is indicated by a check marker for example E).
Note 1: For the new settings to become effective you must restart the Apache server.
Note 2: A greyed out button indicates that version is unavailable and you need to
install an appropriate plugin.
|
|
Installing a PHP plugin
Installing is a misnomer! Nothing is installed to your PCs registry all files are extracted to their appropriate location within the UniServer folder structure.
The extraction procedure is identical for all plugin versions, proceed as follows:
Install PHP plugin
- If running, stop Apache and MySQL servers. Close Unicontroller.
- Download required plugin installation file.
For example ZeroXII_php_5_4_45.exe installs PHP 5.4.45.
- Save the downloaded file to folder UniServerZ.
- Double click on the above installation file. This runs the self extracting archive.
- If prompted allow overwriting of existing files.
- If you wish, delete the installation file, it is no longer required.
|
Clean Install
There are situations where you want to start from a known
clean installation. If the series (53, 54, 55, 56 or 70) you wish
to install already exists navigate to the core folder and
delete the appropriate folder then proceed with the
extraction process.
For example to completely remove 5.4.45 delete folder
C:\UniServerZ\core\php54
|
Enable The PHP plugin
Before the plugin is recognised it requires selecting as follows:
- Click version you wish to use A), B), C), D) or E).
- Previous selection is deselected and new selection enabled.
- Selected PHP version is indicated by a check marker for example E).
- Start Apache and the new version of PHP is recognised.
|
|
Important information
Following lists important information that may catch you out:
1) Over writing an existing series will replace all configuration files. If you have made changes to the configuration files save these files before installing a new version of the same series.
2) Extension artefacts! When installing over an existing series there may be some extensions that are not included with the existing version. These extensions are not deleted and may be incompatible with the new version. It is recommended to perform a clean install as mentioned above.
--oOo--
|