问题描述
我使用nginx和php-fpm作为默认的Web服务器而不使用Apache.因此,为了获得最佳安全性,每个主机都有自己的php-fpm池.
i using nginx and php-fpm as default webserver without apache.So, for best security each host have own php-fpm pool.
我再次遇到了shell_exec问题-我不想为所有用户打开电源,但是我需要对某些主机(1或3台主机,不再使用)使用此功能.
I am have a problem with shell_exec again - i no want to turn on for all users, but i need use this function for some host (1 or 3 hosts, no more).
shell_exec在php.ini中已关闭.我尝试在站点php-fpm池中启用shell_exec,但是它不起作用:
shell_exec is turned off in php.ini.I try to enable shell_exec in site php-fpm pool, but it's not working:
php_admin_value[shell_exec] = on
推荐答案
要考虑的另一件事是禁用主php.ini
文件中的disable_function
.
Something else to consider is to disable the disable_function
in the primary php.ini
file.
然后为每个FPM池设置disable_function
:(例如)
Then set the disable_function
for each FPM Pool: (For example)
php_admin_value[disable_functions] = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
如果您有一个特定的FPM池,需要使用其中一个或多个功能,只需将其从该池配置中删除即可.
If you have a specific FPM Pool which you need to use one or more of those functions, just remove it from that pools configuration.
这篇关于仅对某些主机打开shell_exec的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!