Hi,

1) please try $szPipe and see if you get any output.
2) if you are jailed in /var/htdocs/ your pathname /htdocs/qs is incorrect.
3) I guess you tried running gs from the jail either as yourself or as root.
please see if nobody or apache (the webserver's user) can run gostscript.


all the best

Adam Douglas wrote:

Hi. I'm trying to develop a web interface to the ghostscript (gs)
application. I have the ghostscript syntax down perfectly in the console.
Now when I go to try and do it in PHP I get nothing. No errors, nothing just
a blank page with PHP logs turned on and errors turned on.

I'm running Apache with PHP 4.3.3 on OpenBSD 3.3 i386. In my case Apache
(httpd) is chrooted to /var/htdocs/. So I figured I would have to copy
ghostscript and all it's dependencies to /var/htdocs/ at least for it to
work. Still nothing. Here's the code I used below. At this point I do not
know what direction to go to get this to work or if it is even possible.
I've tried exec(), system() and popen() api functions. I get nothing no
results, no errors what so ever. BTW, ghostscript does appear to work fine
in the chrooted directory via the console. At this point the below code is
all I have. The syntax for ghostscript shown below just outputs the data of
the 2 PDF files to the pdfwrite so it will merge them together into a
merged.pdf file. Quite simple actually.

$szPipe = popen("/htdocs/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
-sOutputFile=/htdocs/merged.pdf /htdocs/Sep08-113518.pdf
/htdocs/Sep08-113523.pdf", "r");

I tried resulting to something simple to get this to work. I took the
example from the PHP manual system() page
(http://www.php.net/manual/en/function.system.php). In this example is it
suppose to return "Last Line of Output: " and "Return value: 127"? This
occurs with system() and passthru(). I thought it should return the last
line of a ls would show in the console.

Any ideas or direction on how to do this would be greatly appreciated.

Thanks!





--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to