Need detailed step to enable Imagemagick + PHP

Discussion in 'Install/Configuration' started by cevo, Sep 4, 2013.

  1. cevo

    cevo Active Member

    I have successfully build PHP 5.5.3 , but now I need to enable ImageMagick with my PHP. Does anyone got a tutorial ? Thank you in advanced.
  2. cevo

    cevo Active Member

    Anyone can help?
  3. NiteWave

    NiteWave Administrator

  4. enigmarokker

    enigmarokker Member

    Please see the link you provided and note that there are no steps on how to build any *.so file.

    Can you please document this and/or point me to the proper location on how to copy/build/move the file into my active litespeed php directory? I've installed image magick and added the extension into my php.ini file...but now I'm stuck at where to locate & copy or build or create the file and place it into my proper LSWS extensions directory.

    Please advise and thanks in advance.
  5. enigmarokker

    enigmarokker Member

    Update...I THINK I've found the link to what you were originally referring to back in must have changed since then:

    Can you please confirm that is the proper link and instructions? If you could provide a specific on imagemagic that'd be very helpful to myself and your other/future customers I'd think. Thanks once more.
  6. enigmarokker

    enigmarokker Member

    Using the APC instructions to make the file I'm completely at a loss...

    Here's your instructions...."go through the regular imagemagick setup and then follow the APC instructions to create the *.so file:...

    Install APC 3.0.11+ through command line
    You can also compile/install for Linux, OS X, FreeBSD, Solaris, etc.

    APC is a very mature opcode-caching module, aka “php accelerator”, and strongly maintained at We highly recommend APC for anyone using php scripts.

    1) Install PHP 4/5 with LSAPI
    Install PHP 4/5 with LSAPI

    2) Download/Expand APC 3.0.11+
    Download and extract source from

    Make sure version 3.0.11 or higher is used. Starting with 3.0.11, --enable-apc will imply --enable-apc-mmap.

    In APC source directory do:

    ./configure --enable-apc --with-php-config=/php5install/php5/bin/php-config
    make install
    3) Configure /lswsinstall/conf/php.ini
    include_path = ".:/php5install/php5"
    ;extension_dir = ./

    Okay well I followed the ImageMagick install instructions here (also pasted below so we're on the same page):

    ImageMagick Install Instructions from
    First of all download a tar image of the ImageMagick install from here:

    Unpack it and then from terminal issue the following commands in
    1. "cd ImageMagick-6.5.7" - go where you placed the folder

    2. "./configure"

    3. "make"

    If ImageMagick configured and compiled without complaint, you are
    ready to install it on your system. Administrator privileges are
    required to install. To install, type the following command in terminal:

    1. "sudo make install"

    To check your ImageMagick installation enter the following command
    in terminal:

    1. "make check"

    Remember all commands are entered into terminal in the directory in
    which you unzipped your downloaded ImageMagick tar file. (the latest
    version of which at this time of writing is ImageMagick-6.5.7.)

    Next we need to install which is what we want for PHP.

    First of all we need to get the right file and we can get that from here:

    At current writing the latest stable version is imagick-2.3.0.

    Unpack the tar file and then enter the commands in quotes in terminal:

    1. "cd imagick-2.2.3" - go where you placed the folder

    2. "phpize"

    3. "./configure --with-imagick=/opt/local"

    4. "make"

    5. "make install"

    If you look at the bottom of the output, it will tell you where it has
    placed the module. For me it was placed in:


    which is where i had unpacked the downloaded imagick-2.3.0 file.

    Then copy it into your MAMP PHP extensions folder.

    For me it was:

    Then, for PHP to honor the the extension, add the following line to the
    extensions section of your php.ini file:

    You should now have a working imagick extension with all of the
    resources for php found here:

    First off, where should I download the ImageMagick install? Anywhere on my server? Or into my LSWS php path?

    At what point in time am I supposed to create an file that goes into my lsphp5x folder? These lines take from Litespeeds instructions for the APC install make zero sense to me:

    ./configure --enable-apc --with-php-config=/php5install/php5/bin/php-config
    make install

    3) Configure /lswsinstall/conf/php.ini

    What is /php5install/php5? The LSWS php directory? Or the default servers' PHP install directory? What is Configure /lswsinstall/conf/php.ini? I dont have a CONF/php.ini folder or file in my LSWS install directory.

    Some specific instructions on how to properly install imagemagick would make a lot more sense to me please and thanks.

    might be really dumb, because I'm trying to make sense of this and after 2 hours I'm not getting anywhere other than instaling ImageMagick the "normal" way onto my server and not getting the file created properly within the LSWS PHP directory...when I run the normal 'phpize' (no LSWS php path chosen) against the imagemagick creates the *.SO file in my LSWS PHP path...however when i try to test imagemagick its telling me that my build numbers are off...

    Also: After following the instructions to install PHP5.6 within Litespeed...when I try to run phpize on Imagemagick, I get the following error...How do I install the phpize and build tools into the Litespeed 5.6 PHP installation?

    [root@srv imagick-3.3.0]#
    Cannot find build files at '/usr/local/lsws/lsphp56/lib64/php/build'. Please check your PHP installation.

    Plz help! Thnx again!
    Last edited: Feb 8, 2016
  7. NiteWave

    NiteWave Administrator

    please ensure you've done following:
    #yum search lsphp56
    #yum install lsphp56-devel

Share This Page