Zero logo

PHP Version Switching

The Uniform Server Zero XIII provides switching between PHP versions 5.3, 5.4, 5.5, 5.6, 7.0 and 7.1 to achieve this you need to download a suitable PHP plugin for each version (for example ZeroXIII_php_5_3_29.exe, ZeroXIII_php_5_4_45.exe, ZeroXIII_php_5_5_37.exe, ZeroXIII_php_5_6_23.exe, ZeroXIII_php_7_0_8.exe and ZeroXIII_php_7_1_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, php70 and php71.

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 that inturn selects a configuration file (php53.conf - php71.conf).

Within the selected configuration file (php53.conf - php71.conf) environment variable PHP_INI_SELECT selects the PHP configuration file to use.

The Apache configuration code for PHP switching is shown on the right.

Note: Configuration file (php53.conf - php71.conf) is installed when a corresponding PHP module is installed.

PHP Plugins

Related to PHP switching, when installing a plugin for an existing PHP series (PHP 53, 54, 55, 56, 70 or 71) 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 php52,
# 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>
   Include ${US_ROOTF}/core/apache2/conf/extra_us/php53.conf
</IfDefine>

<IfDefine php54>
   Include ${US_ROOTF}/core/apache2/conf/extra_us/php54.conf
</IfDefine>

<IfDefine php55>
   Include ${US_ROOTF}/core/apache2/conf/extra_us/php55.conf
</IfDefine>

<IfDefine php56>
   Include ${US_ROOTF}/core/apache2/conf/extra_us/php56.conf
</IfDefine>

<IfDefine php70>
   Include ${US_ROOTF}/core/apache2/conf/extra_us/php70.conf
</IfDefine>

<IfDefine php71>
   Include ${US_ROOTF}/core/apache2/conf/extra_us/php71.conf
</IfDefine>

Apache config file: UniServerZ\core\apache2\conf\extra_us\php53.conf

  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}"

Apache config file: UniServerZ\core\apache2\conf\extra_us\php54.conf

  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}"

Apache config file: UniServerZ\core\apache2\conf\extra_us\php55.conf

  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}"

Apache config file: UniServerZ\core\apache2\conf\extra_us\php56.conf

  LoadFile ${US_ROOTF}/core/php56/libsasl.dll
  LoadFile ${US_ROOTF}/core/php56/icudt54.dll
  LoadFile ${US_ROOTF}/core/php56/icuin54.dll
  LoadFile ${US_ROOTF}/core/php56/icuio54.dll
  LoadFile ${US_ROOTF}/core/php56/icule54.dll
  LoadFile ${US_ROOTF}/core/php56/iculx54.dll
  LoadFile ${US_ROOTF}/core/php56/icutest54.dll
  LoadFile ${US_ROOTF}/core/php56/icutu54.dll
  LoadFile ${US_ROOTF}/core/php56/icuuc54.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}"

Apache config file: UniServerZ\core\apache2\conf\extra_us\php70.conf

  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}"

Apache config file: UniServerZ\core\apache2\conf\extra_us\php71.conf

  LoadFile ${US_ROOTF}/core/php71/libsasl.dll
  LoadFile ${US_ROOTF}/core/php71/icudt57.dll
  LoadFile ${US_ROOTF}/core/php71/icuin57.dll
  LoadFile ${US_ROOTF}/core/php71/icuio57.dll
  LoadFile ${US_ROOTF}/core/php71/icule57.dll
  LoadFile ${US_ROOTF}/core/php71/iculx57.dll
  LoadFile ${US_ROOTF}/core/php71/icuuc57.dll

 # Load PHP module and add handler
  LoadModule php7_module "${US_ROOTF}/core/php71/php7apache2_4.dll"
  AddHandler application/x-httpd-php .php
 # Configure the path to php.ini
  PHPIniDir "${US_ROOTF}/core/php71/${PHP_INI_SELECT}"

UniController PHP Switching

PHP Switching
  • Click version you wish to use A), B), C), D), E) or F).
  • 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.

PHP Switching

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 ZeroXIII_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, 70 or 71) you wish
to install already exists navigate to the core folder and
delete the appropriate folders then proceed with the
extraction process.

For example to completely remove 5.4.45 delete folders
C:\UniServerZ\core\php54
C:\UniServerZ\core\apache2\conf\extra_us\php45.conf

Enable The PHP plugin

Before the plugin is recognised it requires selecting as follows:

  • Click version you wish to use A), B), C), D), E) or F).
  • 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.
UniTray PHP Switching

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--