I am trying to install ImageMagick on my dedicated-virtual Centos server for use with PHP.
I first ran the following commands successfully:
# yum install gcc php-devel php-pear # yum install ImageMagick ImageMagick-devel
Then, I ran this command:
# pecl install imagick
After I ran it, I got this error:
downloading imagick-3.1.2.tgz ... Starting to download imagick-3.1.2.tgz (94,657 bytes) .....................done: 94,657 bytes 15 source files, building running: phpize Configuring for: PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525 shtool at '/var/tmp/imagick/build/shtool' does not exist or is not executable. Make sure that the file exists and is executable and then rerun this script.
ERROR: `phpize' failed
So, I google'd it and found that I should do this:
If you see this error, it most likely means the server’s /tmp directory does not allow executables to run. Set a different temporary directory on a filesystem on which you can execute binaries. For instance: pear config-set temp_dir /root/tmp
Then re-run: pecl upgrade-all
So, I created a new directory in my root and changed the PEAR config variable like so:
# mkdir rw ../tmp2 # pear config-set temp_dir ../tmp2
But, now, after trying to install again I get this error:
# pecl install imagick downloading imagick-3.1.2.tgz ... Starting to download imagick-3.1.2.tgz (94,657 bytes) .....................done: 94,657 bytes ERROR: SECURITY ERROR: file config.m4 (installed to ../tmp2/imagick/config.m4) contains parent directory reference ..
How can I fix this? I just want to install ImageMagick.