我在使用php7(PHP Version 7.0.33-0+deb9u3
)运行使用shell_exec
或exec
的python脚本时遇到问题。你知道吗
如果我运行:var_dump(shell_exec("/usr/bin/python3 /home/pi/Documents/GTranslate/translator.py"));
或var_dump(shell_exec("/home/pi/Documents/GTranslate/translator.py"));
,
我收回NULL
。你知道吗
我已经检查了运行的权限:
$scriptPath = "/home/pi/Documents/GTranslate/translator.py";
var_dump(array(
'file' => is_file($scriptPath),
'readable' => is_readable($scriptPath),
'executable' => is_executable($scriptPath)
));
我得到了一切真实的东西。你知道吗
safe_mode
php.ini文件你知道吗在我的php.ini文件(如phpinfo();
所示)没有类似safe_mode
的字段。从PHP 5.4.0开始读取PHP Wiki函数已被删除。你知道吗
shell_exec()
正在工作函数shell_exec()没有被禁用,因为如果我运行命令:
echo shell_exec("ls -halt /home/pi/Documents/GTranslate/translator.py");
我得到了回报:
-r-xr-x--x 1 pi pi 1.7K Aug 11 12:13 /home/pi/Documents/GTranslate/translator.py
问题出在哪里?
目前没有回答
相关问题 更多 >
编程相关推荐