mercredi 1 avril 2015

php can run the python programm from php shell but not on the webbrowser


Vote count:

0




I have a python script that uses ipyhon and it can be executed when I run it from the terminal using php -a (interactive shell), but when I type localserver/test.php (test.php is the script wrtten with gedit in ubuntu) nothing happens and I only see a blank page. Any idea why?



<?php
$command = escapeshellcmd('/home/administrator/Desktop/test.py');
$output = shell_exec($command);
echo $output;

?>


Just an update: I checked the log file and it gives me a list of errors for example about the pyplot: File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 2460,ax = gca() in plot


But again as I said before the python program works fine and can be executed with php if I run it from the php shell. I don't understand what's going on.



asked 1 min ago







php can run the python programm from php shell but not on the webbrowser

Aucun commentaire:

Enregistrer un commentaire