0

I have Ghostscript and IMagemagick installed on my local machine. I can access the IM functions from the command line. The environment variables are also set.

The problem is that when I try to execute the IM function using PHP's exec() method, I get no result. The same script works on my remote web host.
When the execution is successful, exec() returns a 0. On my local machine, it returns 4.

Is there a way to see any kind of error message returned from exec()? How do I know that PHP is able to find IM?

Any help in this matter would be useful!

2
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by ShawnCplus
0

I have Ghostscript and IMagemagick installed on my local machine. I can access the IM functions from the command line. The environment variables are also set.

The problem is that when I try to execute the IM function using PHP's exec() method, I get no result. The same script works on my remote web host.
When the execution is successful, exec() returns a 0. On my local machine, it returns 4.

Is there a way to see any kind of error message returned from exec()? How do I know that PHP is able to find IM?

Any help in this matter would be useful!

PHP has built-in ImageMagick functions, why are you using an external program?

0

What are those functions? As far as I know, IM' tools have to be called through the command line. And that is what exec() does.

0

Thanks. Looking into it.

No idea about debugging exec()?

0

exec only returns the response code, use shell_exec, that'll get all of the output so if imagemagick is producing errors you'll be able to see them.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.