Jump to content

Can't execute ghostscript


jari

Recommended Posts

Hello

 

I'm having a problem when I try to convert file test.ps to test.png with ghostscript using

 

<?php
$cmd = "gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngmono -sOutputFile=test.png test.ps";
system($cmd,$return_val);
?>

 

and nothing happens. $return_val is 1. I'm running the script on /public_html/php/ that has full read/write/exec permissions for all. I also tried with passthru and exec, with no better results.

 

If I execute the same command in command prompt, gs generates the png-file without any problems. Also, if

$cmd = "gs -h" the script gives me full listing of ghostscript's help.

 

Could anybody tell me what's wrong?

 

--Jari

 

Link to comment
https://forums.phpfreaks.com/topic/40039-cant-execute-ghostscript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.