Cant get php exec to work

前端 未结 3 1552
孤城傲影
孤城傲影 2021-01-17 03:15

I\'ve been fighting with this for a few hours now, and I can\'t seem to work it out. tried exec(), shell_exec(), and system(). Nothing works. I have this:

ex         


        
3条回答
  •  温柔的废话
    2021-01-17 03:53

    According to PHP Manual for exec function:

    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.

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

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

    EDIT: 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.

提交回复
热议问题