Testing the installation

August 10, 2009 by nuno costa 7 comments

phMagick :: Testing the instalation

phMagick requires 2 things ImageMagick and the ability to issues systems calls with the exec() function

 

The easiest way to test the installation is to issue a system call to the convert binary

You can also activate phMagick Debug Mode and see if after running a command you get any errors.

 

One common error on windows systems is "invalid parameter", it usually means that windows is using the convert.exe from system32 (convert is used to convert a file system to NTFS) instead of the ImageMagick convert

Check here for how to solve this

7 comments so far Add Your Comment

  1. by Elizabeth on January 21 2010 at 13:56

    Hi -

    Your library works great on my local MAMP install; however, I would also like to use it on our server (which has imageMagick installed).
    I have permissions to run shell “exec” commands, but one (small) problem I am having is that if I would like to call the script from a browser, the default web-user doesn’t know the full path to the ‘convert’ program that your phmagick class wrapper is calling. I noticed that ‘convert’ is called in several of your plugin files, and rather than changing the path in all of them, I would like to set a path variable in one place (or once in each file that uses convert) and then append this to the convert calls — e.g., $cmd = $p->getBinary(‘convert’); ==> $cmd = $p->getBinary($path.’convert’);

    Where is the best file to add the path to, so it will cascade through the dependent files, and so it will minimize editing through all your plugin files?

    Alternatively, I suppose I could set a $PATH variable for the web-user so that it finds the ‘convert’ program without modifying anything. I just thought the path might be a nice option to have.

    Thank you again for the phmagick class and scripts!

  2. by nuno costa on January 21 2010 at 18:40

    @ Elizabeth

    please see this link http://www.francodacosta.com/blog/phmagick/examples/error-convert-invalid-parameter it has information how how to change the path of imagemagick binaries

    IF you need more help, just ask

  3. by Enrico on February 21 2011 at 17:27

    Hi,

    I have installed ImageMagick on a CentOS. “Make check” passed all 12 tests.

    exec() is not limited by disable_functions in the php.ini, but the testing script do not create the resized.jpg-Image or get any errors.

    I try to set the path to convert with $imageMagickPath = ‘/usr/local/bin/’ and $imageMagickPath = ‘/usr/local/bin/convert’ – no resized-image no any errors.

    Can you help me nuno costa?

  4. by Enrico on February 21 2011 at 18:17

    @nuno costa,

    sorry – the problem is solved – this was a case sensitive file name problem, but now i get a return code: 127.

    The printed command run fine without error in the command line and create the resized.jpg

  5. by Shimix on October 2 2011 at 23:46

    @ enrico,
    Did you manage to fix this issue? I have the same exact problem.

    @ nuno costa,
    can you help here?

    Thanks!

  6. by nuno costa on October 3 2011 at 07:46

    It looks like you don’t have imagemagick on you system path

    try using $phMagick->setImageMagickPath(‘path to imagemagick bin folder’)

    keep me posted

  7. by Shimix on October 3 2011 at 12:23

    Yes.
    Solved the problem.
    Thanks!

More from francodacosta.com

© francodacosta.com - All rights reserved