0
shell.php集成時,腳本不工作:Python的文件處理使用PHP
<?php
shell_exec("python /opt/lampp/htdocs/web_test/script.py ")
?>
script.py:
fo = open("/opt/lampp/htdocs/web_test/hello.txt", "w")
fo.write("Python is a great language.\nYeah its great!!\n")
fo.close()
殼.php <?php她ll_exec(「python /opt/lampp/htdocs/web_test/script.py」)?> –
嘗試提供Python二進制文件的完整路徑,例如'/ usr/bin/python',並確保script.py可以被用戶誰將運行它(萬維網數據?) – apokryfos
還沒有工作 –