So, I use the php program to read the file, make some changes, and then write it to a new file. After that, I call gnuplot using the system call:
system('cat sarx.conf | /usr/bin/gnuplot');
sarx.conf has gnuplot commands for generating a chart. The problem is that if you run my php from the command line (on a Linux server), it generates an image and saves it to disk. But when I do the same, running php in my browser, it generates an image and tries to spit it out in the browser without saving it to disk.
Things I tried:
I might have had problems with permission settings, but that didn't help.
I also hardcoded the path where I want the image to be in sarx.conf . It didnβt help either.
I also tried looking for it in the tmp directory --- no luck !!
Does anyone have any ideas on how I can make this work? I need to save this image to disk so that my site can capture it in order to show the plot later. Is there any php stuff that can capture an image and burn it to disk?
source share