I was trying to figure out how to use the exec command in my php script to call Gnuplot.
First, I’ll give some background context:
I’ve written a few php files that grabs data from a database and puts the recorded values into text files in such a way that they can be read by gnuplot. From there I have a second php file that generates a gnuplot script that has the proper pointers to create the graph.
I can manually go to c:/gnuplot/gnuplot/binary/gnuplot.exe graph.txt and generate the graph manually, but I can’t figure out how to automate it.
Both Linux and Windows suggestions would be helpful! I’m writing it and testing it on windows, but once it’s fixed it is going to our Linux server.
Thanks!
To execute gnuplot on a Linux Machine, you can use the exec() function in php. I am not sure what exactly u want to do with the output, but exec can definitely run the program.