且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法让php exec正常工作

更新时间:2022-04-18 04:46:53

根据exec函数的PHP手册:

According to PHP Manual for exec function:

启用安全模式后,您只能在 safe_mode_exec_dir.出于实际原因,目前不允许 在可执行文件的路径中具有..组件.

When safe mode is enabled, you can only execute files within the safe_mode_exec_dir. For practical reasons, it is currently not allowed to have .. components in the path to the executable.

检查 http://php.net/manual/en/ini.sect.safe-mode.php#ini.safe-mode-exec-dir

另外,请注意,Web服务器用户必须具有写入日志文件的权限.

Also, be aware that the web server user must have permission to write in the log file.

关闭安全模式,不仅要检查 php.ini 文件,还要检查Web服务器中虚拟主机的特定配置,无论是Apache,NginX还是其他.如果使用Plesk,请在虚拟主机中查找httpd.include,并确保将safe_mode也设置为off.

To turn safe mode off, check not only php.ini file but also virtual hosts specific configurations in your web server, whether it is Apache, NginX or other. If you use Plesk, look in vhosts for httpd.include, and make sure that safe_mode is set to off there as well.