LiteSpeed is overwriting disable_functions in PHP ?

ShinJii

Verified User
Joined
Mar 20, 2014
Messages
215
Hi,
I'm using Litespeed (not openlitespeed) and php 8.1 - I have in /usr/local/php81/lib/php.conf.d/90-custom.ini

Code:
disable_functions=dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
max_execution_time = 0
max_input_time = -1
max_input_vars = 30000
memory_limit = 41000M
post_max_size = 4100M
upload_max_filesize = 4100M
max_file_uploads = 300
Everything is working fine except that I can't use for example shell_exec - why? It's enabled in that file....
When I rebuild Litespeed I can see in logs text "PHP has been secured." - it's because of that?
What am I doing wrong?
 
Have a look at this thread, it's explained.
 
You have to see which php configuration is loaded, try in a php file:



And go to "Loaded Configuration File" to see which configuration was loaded.

Regards,
It looks like it should work? ...


Code:
Configuration File (php.ini) Path     /usr/local/php81/lib
Loaded Configuration File     /usr/local/php81/lib/php.ini
Scan this dir for additional .ini files     /usr/local/php81/lib/php.conf.d
Additional .ini files parsed     /usr/local/php81/lib/php.conf.d/10-directadmin.ini, /usr/local/php81/lib/php.conf.d/50-webapps.ini, /usr/local/php81/lib/php.conf.d/90-custom.ini
 
Eeeeeee... it's weird because I checked now in phpinfo() and I have shell_exec enabled... so wtf? why it's not working ? it's not even triggering in php script...
 

Attachments

  • Screenshot 2023-09-19 at 09-31-57 PHP 8.1.22 - phpinfo().png
    Screenshot 2023-09-19 at 09-31-57 PHP 8.1.22 - phpinfo().png
    55.5 KB · Views: 8
Ok it's working...sorry for problem...there was something wrong in script lol.
 
So for all people - disable_functions in /usr/local/php81/lib/php.conf.d/90-custom.ini is working fine even if there's more disabled functions in global php.ini
 
Back
Top