Hello there,
I've a utility that runs on a linux machine. Basically, it opens
a window, draws a figure and captures the image (screen) and stores
it as a jpeg file. The utility requires a window to be open
(or displayed) inorder to save the image. Also, this utility is
in the form of an executable, so I can't possibly alter it.
I want to run this utility from a windows web browser and display
the saved jpeg file. I pass some command line parameters to change
the figure it draws. The php code I use is as below:
<?php
putenv("VIEWER_HOME=/path/to/viewer_home");
//putenv("DISPLAY servername:45");
$prgfile="viewer -m save.mac";
exec($prgfile, $output, $rc);
foreach($output as $row) echo "<br>$row";
echo "<br>";
print_r($rc);
?>
I connect to the linux server from my windows desktop using RealVNC
and the php script works when I run it from the server shell
prompt (using "php <scriptname>"). It opens a display, captures the
image and closes the display. But when I run the script from windows
web browser I get an error (in the apache "error_log" file).
"Error: Can't open display"
Is there a way I can make this work?
TIA,
Hemanth
P.S: I'm not sure if my question is entirely relevant to this group
but any pointers to the right group will be helpful.