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.
The problem was the matplotlib backend setting. I changed to 'Agg' and the plot function worked fine.
Run Python script from PHP