shell_exec() and exec() not working in PHP

前端 未结 2 756
既然无缘
既然无缘 2021-01-15 02:08

Like many others I have problem with shell_exec() function in PHP. I have safe mode disabled and disabled_functions deleted from php.ini.

If I run php script from te

2条回答
  •  别那么骄傲
    2021-01-15 02:39

    Your command line (CLI) PHP might be using a different working directory and/or path than the CGI one. Try defining the working directory (containing the lp command) explicitly with chdir() before calling shell_exec().

提交回复
热议问题