Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed ImageMagick (http://www.imagemagick.org/script/download.php) on a linux server (following the installation steps) - i which to migrate a php application on this new server.

$which mogrify

returns

/usr/local/bin/mogrify

Although mogrify CAN be called from the shell it cannot be found from a server side script (php).

The script contains a system([args]) function which executes the programm [args].

So system('mogrify --someoptions') does nothing at all.

Any ideas on what is wrong? Setup of imagemagick or problem from the php script?

NOTE: The same script executes succesfully on an existing server. On the new server the call to mogrify does nothing at all (permissions and settings are the same).

share|improve this question
    
What platforms? –  Ignacio Vazquez-Abrams Nov 16 '10 at 16:03
    
centos 5.x distro –  andreas Nov 16 '10 at 16:12
add comment

2 Answers

by settings you mean php settings? PHP Safe mode is off? What if you use the full path to mogrify? (system('/usr/local/bin/mogrify --someoptions') Anything in the php/apache error logs?

share|improve this answer
    
can't make changes easily...hundred of files and many places where the call is issued. I'll try this if everything else fails. –  andreas Nov 16 '10 at 16:07
add comment

Use the full path instead of just the binary name. I would imagine that /usr/local is not in the $PATH of the user running PHP.

/usr/local/bin/mogrify, etc.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.