Installing php imagick to xampp
I am trying this:
sudo apt-get install imagemagick libmagickwand-dev
sudo pecl install imagickAnd I getting an error at the end like:
/tmp/pear/temp/imagick/imagick_class.c:9534:2: error: 'struct _php_core_globals' has no member named 'safe_mode'
/tmp/pear/temp/imagick/imagick_class.c:9534:2: error: 'CHECKUID_CHECK_FILE_AND_DIR' undeclared (first use in this function)
/tmp/pear/temp/imagick/imagick_class.c:9534:2: error: 'CHECKUID_NO_ERRORS' undeclared (first use in this function)
make: *** [imagick_class.lo] Error 1
ERROR: `make' failedSo my question is what are the requirements for Installing imagick's latest version on ubuntu. And its procedure to install ?
I have:
PHP Version 5.4.7
XAMPP for Linux 1.8.1
-Thanks
1 Answer
You dont't have to install through PECL or install the MagickWand. Just follow the following steps and everything will work fine.
First of all remove everything what you have tried to make it work. Uninstall ImageMagick by following command,
sudo apt-get remove imagemagick
sudo apt-get remove --auto-remove imagemagick
sudo apt-get purge imagemagickWell, all your previous installation files are just gone. Now Install it purely and perfectly without any conflict or file modification. Enter the following two commands,
sudo apt-get install imagemagick
sudo apt-get install php5-imagickThat was way too easy - thanks interwebs! Remember to restart/reload your webserver..
sudo service apache2 gracefulThat's all. Check your php.ini or test with any simple script. You can find some simple scripts here