Posts Tagged ‘centos’

Installare imagemagick con l’estensione imagick per PHP su CentOS

Per installare imagemagick con l’estensione imagick per PHP su una CentOS è sufficiente seguire questi passi:
yum install ImageMagick.i386
yum install ImageMagick-devel.i386
pecl install imagick

Nel caso in cui abbiate questo errore:
root@myhost [~]# pecl install imagick
downloading imagick-3.0.1.tgz ...
Starting to download imagick-3.0.1.tgz (93,920 bytes)
.....................done: 93,920 bytes
13 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Please provide the prefix of Imagemagick installation [autodetect] :
building in /var/tmp/pear-build-root/imagick-3.0.1
running: /root/tmp/pear/imagick/configure --with-imagick
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/imagick/configure --with-imagick' failed

Date un’occhiata alla vostra directory /tmp… quasi sicuramente è montata con il flag noexec. Remount it without noexec e riprovate:
mount -o remount,rw /tmp

Una volta terminata l’installazione, create un file di inclusione per il modulo imagick.so e riavviate apache:
echo "extension=imagick.so" > /etc/php.d/imagick.ini
/etc/init.d/httpd restart

Testate il corretto caricamento del modulo imagick tramite:
php -m | grep imagick

Installare yum e php-pear su Centos 5

I server virtuali come quelli di Aruba sono spesso configurati con Centos senza yum e senza php-pear. Dovendo oggi fare un’assistenza ad un server di un cliente che necessitava dell’installazione di pear ho dovuto rimboccarmi le maniche per far girare tutto quanto. Perché poi abbiano deciso di non includere yum di default questo ancora lo devo capire…

Innanzi tutto installiamo yum:

mkdir /root/matteo && cd /root/matteo
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/gmp-4.1.4-10.el5.i386.rpm
rpm -Uvh gmp-4.1.4-10.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/readline-5.1-3.el5.i386.rpm
rpm rpm -Uvh readline-5.1-3.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-2.4.3-27.el5.i386.rpm
rpm -Uvh python-2.4.3-27.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/libxml2-2.6.26-2.1.2.8.i386.rpm
rpm -Uvh libxml2-2.6.26-2.1.2.8.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/libxml2-python-2.6.26-2.1.2.8.i386.rpm
rpm -Uvh libxml2-python-2.6.26-2.1.2.8.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/expat-1.95.8-8.3.el5_4.2.i386.rpm
rpm -Uvh expat-1.95.8-8.3.el5_4.2.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
rpm -Uvh python-elementtree-1.2.6-5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/sqlite-3.3.6-5.i386.rpm
rpm -Uvh sqlite-3.3.6-5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -Uvh python-sqlite-1.1.7-1.2.1.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/elfutils-0.137-3.el5.i386.rpm
rpm -Uvh elfutils-0.137-3.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/rpm-python-4.4.2.3-18.el5.i386.rpm
rpm -Uvh rpm-python-4.4.2.3-18.el5.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/m2crypto-0.16-6.el5.6.i386.rpm
rpm -Uvh m2crypto-0.16-6.el5.6.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-urlgrabber-3.1.0-5.el5.noarch.rpm
rpm -Uvh python-urlgrabber-3.1.0-5.el5.noarch.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm
rpm -Uvh yum-3.2.22-26.el5.centos.noarch.rpm
yum -y update

Adesso è il momento di installare php-pear:

yum install php-pear*

Adesso sotto ogni virtual-host di Plesk (/var/www/vhosts/example.com/conf/httpd.include), risiede la direttiva open_basedir che va configurata nel modo corretto aggiungendo il path di pear:

php_admin_value open_basedir "/var/www/vhosts/example.com/httpdocs:/tmp:/usr/share/pear:/local/PEAR"

Stessa cosa, va configurato pear in /etc/php.ini

include_path=".:/usr/share/pear:/local/PEAR/"

Infine riavviamo apache:

/etc/init.d/httpd restart