Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/149.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php shell_exec()跳过python脚本_Php_Python_Apache2_Shell Exec - Fatal编程技术网

php shell_exec()跳过python脚本

php shell_exec()跳过python脚本,php,python,apache2,shell-exec,Php,Python,Apache2,Shell Exec,在Ubuntu 12.04 LTS上使用Apache 2 web服务器 我使用shell\u exec()运行shell脚本 它运行除我运行python脚本的部分之外的所有脚本,例如pythonscript.py 当我从终端运行shell脚本时,它工作得很好 你知道我该怎么解决这个问题吗?可能与权限有关吗 干杯只是想知道。。为什么要使用Ubuntu 12.04 LTS?确保运行apache(通常是Ubuntu上的www数据)的用户有权执行该文件。您还应该确保使用绝对路径,因为该用户没有与“普通”

在Ubuntu 12.04 LTS上使用Apache 2 web服务器

我使用
shell\u exec()
运行shell脚本

它运行除我运行python脚本的部分之外的所有脚本,例如
pythonscript.py

当我从终端运行shell脚本时,它工作得很好

你知道我该怎么解决这个问题吗?可能与权限有关吗


干杯

只是想知道。。为什么要使用Ubuntu 12.04 LTS?确保运行apache(通常是Ubuntu上的www数据)的用户有权执行该文件。您还应该确保使用绝对路径,因为该用户没有与“普通”用户相同的环境变量。类似于:
/path/to/python/path/to/pythonfile.py
@MagnusEriksson我更改为绝对路径,但仍然没有更改。您认为我必须授予对/usr/bin/python的访问权限吗?