I want to run Python script from PHP. The script's syntax is good, when I run it from command line it generates an image file next to it. When I run the PHP file (contains Python exec) from command line it generates an image file. It's good. The problem is: when I use browser and run PHP it isn't generate any image file. I use Xubuntu OS.
相关问题
- Views base64 encoded blob in HTML with PHP
- how to define constructor for Python's new Nam
- Laravel Option Select - Default Issue
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
The problem was the matplotlib backend setting. I changed to 'Agg' and the plot function worked fine.
Does the script that you are trying to run requires sudo privileges? If so, you will need to add the user "www-data" or web user with the command (full path) to the sudoers file (Ubuntu /etc/sudoers or execute visudo command).
More info here https://help.ubuntu.com/community/Sudoers
Another thing to look at is at memory_limit in your php.ini directive. You might be using all memory allowed to use.