Can't load user PHP.INI

bloom360

Active Member
#1
Hello,
I am running LS Enterprise on CentOS 6.9 on WHM as follows:
- Run on Startup: NO
- Auto Start: Through CGI Daemon
- PHP suEXEC: Yes
- On WHM pre_virtualhost_global.conf:
<IfModule LiteSpeed>
LSPHP_ProcessGroup on
LSPHP_Workers 15
</IfModule>​
- On LS External App > Environment added "LSPHP_ENABLE_USER_INI=on"
- Open Base Dir enabled on WHM

When I edit some of the values using cPanel's GUI, especially max execution, memory limit and max upload, they work no problem.
However, using the same GUI, if I enable url fopen, nothing happens. I checked on a phpinfo and neither of the local files php.ini or .user.ini are being loaded.
I particularly need to set these but they are being entirely ignored?
Code:
upload_tmp_dir = /something/else
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1
So my question is how to make LS load user .ini files and also, why in the world is it reading properly the max execution and other vars, but not others. Do I need to manually enable which directives LS will load via a user ini?
Many thanks
 
Last edited by a moderator:

bloom360

Active Member
#3
Where can I find my version number?
And if it is old, how can I update it? I found your docs say the Compile PHP tool should no longer be used.
 

Pong

Well-Known Member
Staff member
#4
If you use multi-PHP from cpanel, you can go through whm admin multi-php ini editor or directly modify cpanel ea php.ini. The same way you need to do when using cpanel and apache.
 

bloom360

Active Member
#7
I am running WHM, can i just update directly via yum and nothing will break?

Second, would it just be yum upgrade lsphp ? Or do i need to update the repository first? Or add parameters to the command so it compiles with certain modules? Can you please provide exact steps for CentOS 6.9? This is not my expertise and i am worried to break the server entirely.
Thanks
 

NiteWave

Administrator
#8
if you use WHM, no need manually run "yum upgrade lsphp", WHM/cPanel will do it for you.
what's your WHM version, are you using easyapache 3 or 4 ? have you created a phpinfo page ?
 

bloom360

Active Member
#9
I have checked and have LiteSpeed V6.11 according to phpinfo.
That means I should be able to load separate ini files, no?
phpinfo also says the environment variable LSPHP_ENABLE_USER_INI is ON, still the ini files are having full effect. As mentioned in an earlier message, I can set max memory and some variables, but they seem to ignore most other directives.
 
#10
http://php.net/manual/en/configuration.file.per-user.php
Only INI settings with the modes PHP_INI_PERDIR and PHP_INI_USER will be recognized in .user.ini-style INI files.
I created a .user.ini file:
Code:
max_execution_time=666
upload_tmp_dir=/tmp
and access phpinfo,
max_execution_time has effect, but upload_tmp_dir no effect.
this is because http://www.php.net/manual/en/ini.list.php
Code:
upload_tmp_dir    PHP_INI_SYSTEM
max_execution_time  PHP_INI_ALL
so you can change max_execution_time via .user.ini, but can't change upload_tmp_dir via .user.ini

if you want to enable per user php.ini, please refer
https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:php:per-user-php-ini
 
Last edited by a moderator:
#11
Thanks, I wanted to use PHP_INI_SCAN_DIR=$VH_ROOT/public_html but this held me back:
This method is not recommended if you replace Apache with suPHP. When replacing Apache with suPHP, the PHPRC environment variable is recommended
Given my specs (see first message in this thread) do you advise I should or should not use this method?
Regards
 
Last edited by a moderator:

Jon K

Administrator
Staff member
#12
I would try something like
Code:
PHP_INI_SCAN_DIR=:$VH_ROOT/public_html
The : inside of there allows it to add all the other .ini's as well but will prioritize anything in public_html.
 

Pong

Well-Known Member
Staff member
#14
Do you use SuPHP on apache? mostly likely not since fastcgi is used most in WHM. If so, then no need to worry.
 
#15
Hi,
Yes I have mod_suphp installed on the active Easy Apache 4 profile. Does this mean that PHP_INI_SCAN_DIR is not recommended?
Server is running on WHM 68.0.15, by the way.
 
Top