Imagick 3.x won't work with PHP 5.3.x

Scolpy

Verified User
Joined
Feb 25, 2009
Messages
115
Imagick 3.x not working with PHP 5.3.x

Hello!

regarding to this blog post, I understand that my issue is not specific to me but for everyone who have PHP 5.3.x and trying to install Imagick 3.x.

Someone wrote on the replies that he changed the PKG_CONFIG_PATH and it's fixed his issue.
How can I change the PKG_CONFIG_PATH and there is better or other solutions for this issue?
 
Last edited:
Only a week ago I successfully installed imagick. I don't use pecl; I just download the thing at http://pecl.php.net/get/imagick - untar it -> phpize -> configure -> make -> make install -> make sure the .so is in correct paths and it all worked. Got PHP 5.3.9.
 
It says how to add the config path for pkg as a environment variable since thats what the comment on the blog post said. To be precise, try adding

Code:
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH

right under 'export PATH' in the /etc/profile file. But again make sure these 2 directories are correct for your system.
 
also you probably need to relogin to make it active or type source /etc/profile, or just execute the two lines in ssh since its all just bash.
 
It says how to add the config path for pkg as a environment variable since thats what the comment on the blog post said. To be precise, try adding

Code:
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH
right under 'export PATH' in the /etc/profile file. But again make sure these 2 directories are correct for your system.

I've added those lines to /etc/profile file and I still have this issue. this is the file content:
Code:
# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

pathmunge () {
    if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
       if [ "$2" = "after" ] ; then
          PATH=$PATH:$1
       else
          PATH=$1:$PATH
       fi
    fi
}

# ksh workaround
if [ -z "$EUID" -a -x /usr/bin/id ]; then 
    EUID=`id -u`
    UID=`id -ru`
fi

# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /sbin
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
fi

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

if [ -x /usr/bin/id ]; then
    USER="`id -un`"
    LOGNAME=$USER
    MAIL="/var/spool/mail/$USER"
fi

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi

[B]export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH[/B] [B]
export PKG_CONFIG_PATH[/B]

for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "$PS1" ]; then
            . $i
        else
            . $i >/dev/null 2>&1
        fi
    fi
done

unset i
unset pathmunge
also you probably need to relogin to make it active or type source /etc/profile, or just execute the two lines in ssh since its all just bash.

You mean to execute the command:
Code:
source /etc/profile
in order to refresh the file?

thanks!
 
Hey guys,

I want to notice that I resolved that issue by doing those steps:
  1. go into imagick folder
  2. $ phpize
  3. $ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ (it's can be different in your machine!)
  4. $ ./configure
  5. $ make
  6. $ make install
  7. add "extension = "imagick.so" in the bottom of the php.ini
  8. restart the web server
good luck! ;)
 
Last edited:
Back
Top