Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
litespeed_wiki:per_user_php_ini [2014/07/29 19:53] Michael Armstrong |
litespeed_wiki:per_user_php_ini [2015/07/28 19:55] Michael Alegre removed |
||
---|---|---|---|
Line 5: | Line 5: | ||
===== 1. Define PHPRC at the Server Level in the WebAdmin Console ===== | ===== 1. Define PHPRC at the Server Level in the WebAdmin Console ===== | ||
- | Defining ''PHPRC'' in the WebAdmin console allows you to use a variable that can set a standard location for the php.ini file in each virtual host. | + | Defining the PHPRC environment variable in the WebAdmin console allows you to use a variable that can set a standard location for the php.ini file in each virtual host. |
In your external application Environment setting (WebAdmin console > Server > External App > lsphp5), enter: ''PHPRC=variable/php.ini/directory'' | In your external application Environment setting (WebAdmin console > Server > External App > lsphp5), enter: ''PHPRC=variable/php.ini/directory'' | ||
Line 24: | Line 24: | ||
===== 2. Define PHPRC in Apache Configs ===== | ===== 2. Define PHPRC in Apache Configs ===== | ||
- | Defining ''PHPRC'' in Apache's virtual host configurations allows you to set a php.ini location for a specific virtual host. | + | Defining the PHPRC environment variable in Apache's virtual host configurations allows you to set a php.ini location for a specific virtual host. |
In the Apache virtual host configuration file, add ''SetEnv PHPRC /php.ini/directory''. | In the Apache virtual host configuration file, add ''SetEnv PHPRC /php.ini/directory''. | ||
Line 30: | Line 30: | ||
**Note:** | **Note:** | ||
* Using this method will cause LSWS to ignore any global php.ini files and only use the user-defined php.ini. | * Using this method will cause LSWS to ignore any global php.ini files and only use the user-defined php.ini. | ||
- | * This method is only supported in LSWS 4.2.13 and up. | + | * This method is supported in LSWS 4.2.13 and up. |
===== 3. Define PHP_INI_SCAN_DIR at the Server Level in the WebAdmin Console ===== | ===== 3. Define PHP_INI_SCAN_DIR at the Server Level in the WebAdmin Console ===== | ||
- | Using the ''PHP_INI_SCAN_DIR'' environment variable allows you to use a variable that can set a standard location for the php.ini file in each virtual host. Unlike ''PHPRC'', though, ''PHP_INI_SCAN_DIR'' allows the use of the global php.ini file with the addition of a per-user php.ini. | + | Using the PHP_INI_SCAN_DIR environment variable allows you to use a variable that can set a standard location for the php.ini file in each virtual host. Unlike the PHPRC environment variable, though, PHP_INI_SCAN_DIR allows the use of the global php.ini file with the addition of a per-user php.ini. |
In your external application Environment setting (WebAdmin console > Server > External App > lsphp5), enter: ''PHP_INI_SCAN_DIR=variable/php.ini/directory'' | In your external application Environment setting (WebAdmin console > Server > External App > lsphp5), enter: ''PHP_INI_SCAN_DIR=variable/php.ini/directory'' | ||
Line 49: | Line 49: | ||
**Note:** | **Note:** | ||
- | * This method is not recommended if you replace Apache with suPHP. When replacing Apache with suPHP, ''PHPRC'' is recommended. | + | * This method is not recommended if you replace Apache with suPHP. When replacing Apache with suPHP, the PHPRC environment variable is recommended. |
- | * PHP_INI_SCAN_DIR is available for PHP 5.2.7 and up. | + | * The PHP_INI_SCAN_DIR environment variable is available for PHP 5.2.7 and up. |
===== 4. Define PHPIniDir in Apache Configs ===== | ===== 4. Define PHPIniDir in Apache Configs ===== | ||
Line 65: | Line 65: | ||
* **PHP suEXEC MUST BE ENABLED IN LSWS.** | * **PHP suEXEC MUST BE ENABLED IN LSWS.** | ||
* Make sure the php.ini file is readable by the suEXEC user. | * Make sure the php.ini file is readable by the suEXEC user. | ||
- | * Option 3 could be used along with option 1, 2, or 4 without conflicts. However, it should rarely be needed in the per user setup. | + | * Option 3 can be used along with options 1, 2, or 4 without conflicts. However, this should rarely be needed. |
- | * Option 4 takes precedence over options 1 and2 should they be used at the same time. | + | * Option 4 takes precedence over options 1 and 2 should they be used at the same time. |
- | * Changes in the php.ini will not be picked up until new PHP process starts. This is because php.ini is read for the first time when a php process starts. | + | * Changes in the php.ini will not be picked up until new PHP process starts. The php.ini is read for the first time when a PHP process starts. |
* Per-user php.ini files are not compatible with [[http://www.litespeedtech.com/products/litespeed-sapi/php/suexec-daemon-mode|suEXEC Daemon mode]]. Our [[http://www.litespeedtech.com/products/litespeed-sapi/php/guide-to-suexec-setups|two other PHP suEXEC setups]] both support per-user php.ini. | * Per-user php.ini files are not compatible with [[http://www.litespeedtech.com/products/litespeed-sapi/php/suexec-daemon-mode|suEXEC Daemon mode]]. Our [[http://www.litespeedtech.com/products/litespeed-sapi/php/guide-to-suexec-setups|two other PHP suEXEC setups]] both support per-user php.ini. |