加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

配置 – 在php-fpm中设置php_admin_value是否有限制?

发布时间:2020-12-13 13:56:04 所属栏目:PHP教程 来源:网络整理
导读:我试图在php-fpm的池配置中设置一个大值,但在某些时候它只是不再启动. php_admin_value[disable_functions] = dl,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source,pcntl_exec,include,include_once,
我试图在php-fpm的池配置中设置一个大值,但在某些时候它只是不再启动.
php_admin_value[disable_functions] = dl,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source,pcntl_exec,include,include_once,require,require_once,posix_mkfifo,posix_getlogin,posix_ttyname,getenv,get_current_use,proc_get_status,get_cfg_va,disk_free_space,disk_total_space,diskfreespace,getcwd,getlastmo,getmygid,getmyinode,getmypid,getmyuid,ini_set,mail,proc_nice,proc_terminate,proc_close,pfsockopen,fsockopen,apache_child_terminate,posix_kill,posix_setpgid,posix_setsid,posix_setuid,fopen,tmpfile,bzopen,gzopen,chgrp,chmod,chown,copy,file_put_contents,lchgrp,lchown,link,mkdi,move_uploaded_file,rename,rmdi,symlink,tempnam,touch,unlink,iptcembed,ftp_get,ftp_nb_get,file_exists,file_get_contents,file,fileatime,filectime,filegroup,fileinode,filemtime,fileowne,fileperms,filesize,filetype,glob,is_di,is_executable,is_file,is_link,is_readable,is_uploaded_file,is_writable,is_writeable,linkinfo,lstat,pathinfo,readfile,readlink,realpath,stat,gzfile,create_function

当尝试重新启动php-fpm时,它失败并显示以下消息:

Stopping php-fpm:                                          [  OK  ]
Starting php-fpm: [20-Oct-2013 22:31:52] ERROR: [/etc/php-fpm.d/codepad.conf:235] value is NULL for a ZEND_INI_PARSER_ENTRY
[20-Oct-2013 22:31:52] ERROR: Unable to include /etc/php-fpm.d/codepad.conf from /etc/php-fpm.conf at line 235
[20-Oct-2013 22:31:52] ERROR: failed to load configuration file '/etc/php-fpm.conf'
[20-Oct-2013 22:31:52] ERROR: FPM initialization failed
                                                           [FAILED]

当我删除最后一个禁用的功能(create_function)时,它会再次启动.我也尝试过其他函数,但这会产生相同的错误,因此它与create_function函数无关.

该字符串目前的大小只有1KB以上,所以看起来我已经达到了极限?

我的假设是否正确?有没有办法克服这个限制?

我还尝试在它下面添加另一个php_admin_value [disable_functions](希望它会被追加),但是这不起作用(它只使用了第一个).

这是一个php-fpm错误.

在ini读取周期中有一个硬编码的1024字符行长度限制,可以在这里看到:

http://lxr.php.net/xref/PHP_5_5/sapi/fpm/fpm/fpm_conf.c#1495

所以目前,你有点不走运 – 因为读取缓冲区是sizeof(char)*(1024 1)字节,并且它寻找新行作为终结符,没有什么可以让它理解配置指令比这更长.

我已经reported a bug了,并计划在接下来的几天内解决它.

编辑:我现在创建一个PR,修复了这个bug.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读