PHP Switching
In order to switch between PHP versions, environment variable PHP_SELECT is set to the selected PHP version. Valid values are php7x and php8x, x being the php series number installed on your system.
To ensure correct PHP configuration file is used, environment 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, in turn, selects a configuration file (for example, php8x.conf or php8y.conf).
Within the selected configuration file (for example, php8x.conf or php8y.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 (for example, php8x.conf or php8y.conf) is installed when a corresponding PHP module is installed.
PHP Modules
Related to PHP switching, when installing a module over an existing PHP series (for example, replacing ZeroXV_php_8_1_4.exe with ZeroXV_php_8_1_5.exe), it is assumed you want to use it instead of the one currently installed. This allows you to revert 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
# php7x, php7y, (...), php8x, php8y, (...). It is used in the
# following define statements to select a PHP version to
# load as a module.
Define ${PHP_SELECT}
<IfDefine php7x>
Include ${US_ROOTF}/core/apache2/conf/extra_us/php7x.conf
<IfDefine>
<IfDefine php7y>
Include ${US_ROOTF}/core/apache2/conf/extra_us/php7y.conf
<IfDefine>
(...)
<IfDefine php8x>
Include ${US_ROOTF}/core/apache2/conf/extra_us/php8x.conf
<IfDefine>
<IfDefine php8y>
Include ${US_ROOTF}/core/apache2/conf/extra_us/php8y.conf
<IfDefine>
(...)
Apache config file: UniServerZ\core\apache2\conf\extra_us\php7x.conf
LoadFile ${US_ROOTF}/core/php7x/libsasl.dll
LoadFile ${US_ROOTF}/core/php7x/icudtxx.dll
LoadFile ${US_ROOTF}/core/php7x/icuinxx.dll
LoadFile ${US_ROOTF}/core/php7x/icuioxx.dll
LoadFile ${US_ROOTF}/core/php7x/iculexx.dll
LoadFile ${US_ROOTF}/core/php7x/iculxxx.dll
LoadFile ${US_ROOTF}/core/php7x/icuucxx.dll
# Load PHP module and add handler
LoadModule php7_module "${US_ROOTF}/core/php7x/php7apache2_4.dll"
AddHandler application/x-httpd-php .php
# Configure the path to php.ini
PHPIniDir "${US_ROOTF}/core/php7x/${PHP_INI_SELECT}"
|