我在php.ini中禁用了函数,但是backticks操作符仍然工作!
disable_functions = “apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd, eval, exec, fp, fput, ftp_connect, ftp_exec, ftp_get, ftp_login, ftp_nb_fput, ftp_put, ftp_raw, ftp_rawlist, highlight_file, ini_alter, ini_get_all, ini_restore, inject_code, mysql_pconnect, openlog, passthru, php_uname, phpAds_remoteInfo, phpAds_XmlRpc, phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_setuid, posix_uname, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, curl_exec,curl_multi_exec,parse_ini_file,show_source, symlink”

怎么才能让这个操作员停用?
richarvey/nginx-php-fpm的系统linux :最新的docker容器
PHP 7.2.4 (cli) (构建:2018年4月5日02:39:05) ( NTS )
发布于 2018-05-28 11:17:22
显然,这只在使用php -r调用时才会显示出来。在PHP文件中使用时,回勾操作符不起作用,正如预期的那样。我猜,实际的shell正在调用echo 1,它是在PHP执行之前注入到PHP代码中的,所以您实际上是在执行:
echo 1;发布于 2018-05-28 09:49:50
来自php.net:
当启用安全模式或禁用shell_exec()时,将禁用回拨运算符。
来源:http://php.net/manual/en/language.operators.execution.php
发布于 2021-12-05 03:08:10
试着把它叫做
php -r "echo \`echo 1\`;"所以它会回来的
Fatal error: Uncaught Error: Call to undefined function shell_exec() in Command line code:1
Stack trace:
#0 {main}
thrown in Command line code on line 1
不正确
如果你跑
php -r "echo `echo 1`;"Bash将在PHP之前运行它,并转换为
php -r "echo 1;"然后将其发送到php。
然后php将返回1给您。
https://stackoverflow.com/questions/50562008
复制相似问题