php exec()命令不在apache Windows中执行
我正在尝试运行php exec()命令,但是它没有执行。它在NGINX上起作用,但在Apache上不起作用。我正在使用Windows。
$cmdex = exec('cmd /c C:\nginx-1.20.2\html\pythonbatch.bat');
echo $cmdex;
我尝试了不同的解决方案,例如更改权限和配置文件,但它不起作用。当我运行PHP程序时,它会输出此功能,但不会执行:
C:\Apache24\htdocs>exit
PHP通常可以正常工作,但是当我做任何与执行有关的事情时,它无效。
编辑:要澄清,PHP在执行命令独立时可以工作,但在浏览器中不起作用。
I'm trying to run the PHP exec() command, but it doesn't execute. It works on NGINX but doesn't work on Apache. I'm using Windows.
$cmdex = exec('cmd /c C:\nginx-1.20.2\html\pythonbatch.bat');
echo $cmdex;
I've tried different solutions like changing the permission and config files, but it doesn't work. When I run the PHP program, it outputs this but doesn't execute:
C:\Apache24\htdocs>exit
PHP works fine in general, but when I do anything that has to do with executing, it doesn't work.
EDIT: To clarify, PHP works when executing the command standalone but doesn't work in browser.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论