Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
litespeed_wiki:php:per-user-php-ini [2019/08/30 16:02] Lisa Clarke [cPanel MultiPHP INI Editor Support] Copyedited |
litespeed_wiki:php:per-user-php-ini [2019/12/12 17:05] Jackson Zhang [7. Override External Application Environment Variables] |
||
---|---|---|---|
Line 154: | Line 154: | ||
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. | 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'' | + | For the control panel environment such as cpanel, ea-phpxx will normally load the main php.ini then scan additional xxx.ini for each php packages already, such as ea-php73 as the following: |
+ | {{ :litespeed_wiki:php:per-user-php-ini-additional-ini1.png?800 |}} | ||
- | Example: | + | To avoid missing the above additional folder scanning from ''/opt/cpanel/ea-php73/root/etc/php.d'', you should specify PHP_INI_SCAN_DIR milti additional scanning folders instead of just one separating with '':''. |
- | PHP_INI_SCAN_DIR=$VH_ROOT/public_html | + | In your external application Environment setting (WebAdmin console > Server > External App > lsphp73), enter: |
+ | |||
+ | PHP_INI_SCAN_DIR=/opt/cpanel/ea-php73/root/etc/php.d:$VH_ROOT/public_html | ||
+ | or simplly as: | ||
+ | PHP_INI_SCAN_DIR=:$VH_ROOT/public_html | ||
+ | {{ :litespeed_wiki:php:per-user-php-ini-additional-ini2.png?800 |}} | ||
+ | |||
+ | After you save the change and restart LSWS, the phpinfo of the accounts using lsphp73 should change to similar to the following by scanning additional ''.ini'' for additional folder from ''$VH_ROOT/public_html''. | ||
+ | {{ :litespeed_wiki:php:per-user-php-ini-additional-ini3.png?800 |}} | ||
The variables available for use are: | The variables available for use are: | ||
Line 210: | Line 219: | ||
</IfModule> | </IfModule> | ||
+ | ===== 8. ''disable_functions'' can only be used in global php.ini and can not be overriden by additional user's local .user.ini/php.ini, nor .htaccess ===== | ||
+ | |||
+ | Please be aware that ''disable_functions'' is unique and can not be used in .htaccess, user's local ''.user.ini/php.ini''. You should only apply ''disable_functions'' on global php.ini for LiteSpeed by modifying the value from ''/opt/cpanel/ea-phpxx/root/etc/php.ini''. | ||
===== Notes ===== | ===== Notes ===== | ||
* **PHP suEXEC MUST BE ENABLED IN LSWS.** | * **PHP suEXEC MUST BE ENABLED IN LSWS.** |