Rob Oplawar
July 3rd, 2008, 03:49 PM
you probably won't be able to help me with this, but it's worth a shot.
I'm currently working on a web based application for my job, and right now I need to get 2D plotting capability in it. I'm currently running Linux, using PHP to generate the views, and I'm trying to use gnuplot to generate the plots. So if you don't know gnuplot and Linux, you won't be able to help me here.
So, I have my php script, gnuplot.php, which inspects the query string for parameters for the plot, and then uses proc_open to get a gnuplot process running. I feed the data into gnuplot, and then send it the plot command, and then I send a Content-type:image/png header and echo out the gnuplot stdout stream.
Problem is, I'm not getting that far- when I send gnuplot the plot command, it sends me back this message:
gnuplot: symbol lookup error
gnuplot: undefined symbol: gdImageSetAntiAliased
Gnuplot works just fine when I'm running it from a terminal, even when I su to www-data, which is the user that Apache runs as, and I'm pretty sure that's the user PHP runs as, and gnuplot runs as a child process of that.
... fake edit: oops, I just ran a top -u www-data, and that's not reporting any processes under that name... am I just failing at my usage of top, or is apache actually running as a different user?
Aaaaanyway, I did a google search on the error I'm getting, and I can't turn up anything. I can't figure out what is wrong with this thing, and I need to get 2D plotting working before next week (I can work over the 3 day weekend). I'd post on a forum devoted to php or gnuplot or the like, except that whenever I do that I get on average about 1 response every 5 days, and even then it's completely unhelpful.
[/longpost]
tl;dr: Anybody here know Linux, PHP/Apache, and gnuplot? Plz help!
e: so I tried skipping the stdout thing and setting output to a file, but it always gives me a permission denied error. Even when I try setting output to STDOUT it tells me permission denied. What the fuck. This is annoying.
I'm currently working on a web based application for my job, and right now I need to get 2D plotting capability in it. I'm currently running Linux, using PHP to generate the views, and I'm trying to use gnuplot to generate the plots. So if you don't know gnuplot and Linux, you won't be able to help me here.
So, I have my php script, gnuplot.php, which inspects the query string for parameters for the plot, and then uses proc_open to get a gnuplot process running. I feed the data into gnuplot, and then send it the plot command, and then I send a Content-type:image/png header and echo out the gnuplot stdout stream.
Problem is, I'm not getting that far- when I send gnuplot the plot command, it sends me back this message:
gnuplot: symbol lookup error
gnuplot: undefined symbol: gdImageSetAntiAliased
Gnuplot works just fine when I'm running it from a terminal, even when I su to www-data, which is the user that Apache runs as, and I'm pretty sure that's the user PHP runs as, and gnuplot runs as a child process of that.
... fake edit: oops, I just ran a top -u www-data, and that's not reporting any processes under that name... am I just failing at my usage of top, or is apache actually running as a different user?
Aaaaanyway, I did a google search on the error I'm getting, and I can't turn up anything. I can't figure out what is wrong with this thing, and I need to get 2D plotting working before next week (I can work over the 3 day weekend). I'd post on a forum devoted to php or gnuplot or the like, except that whenever I do that I get on average about 1 response every 5 days, and even then it's completely unhelpful.
[/longpost]
tl;dr: Anybody here know Linux, PHP/Apache, and gnuplot? Plz help!
e: so I tried skipping the stdout thing and setting output to a file, but it always gives me a permission denied error. Even when I try setting output to STDOUT it tells me permission denied. What the fuck. This is annoying.