Mette a jour PHP sur CentOS 6 avec Plesk 11.5 ou 12

Bonjour.
Aujourd'hui je vous présente un script que j'ai trouvé pour mettre à  jour PHP sur un serveur fonctionnent sous CentOS avec Plesk 12.


Code :


#!/bin/bash

yum -y update &'&' yum -y install wget
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

mkdir /php
cd /php

yum -y install gcc make gcc-c++ cpp kernel-headers.x86_64 libxml2-devel openssl-devel \
bzip2-devel libjpeg-devel libpng-devel freetype-devel openldap-devel postgresql-devel \
aspell-devel net-snmp-devel libxslt-devel libc-client-devel libicu-devel gmp-devel curl-devel \
libmcrypt-devel unixODBC-devel pcre-devel sqlite-devel db4-devel enchant-devel libXpm-devel \
mysql-devel readline-devel libedit-devel recode-devel libtidy-devel libtool-ltdl-devel

wget http://nl1.php.net/get/php-5.5.23.tar.gz/from/this/mirror -O /php/php-5.5.23.tar.gz

tar xzvf /php/php-5.5.23.tar.gz

cd /php/php-5.5.23

./configure \
--with-libdir=lib64 \
--cache-file=./config.cache \
--prefix=/php/php-5.5.23 \
--with-config-file-path=/php/php-5.5.23/etc \
--disable-debug \
--with-pic \
--disable-rpath \
--with-bz2 \
--with-curl \
--with-freetype-dir=/php/php-5.5.23 \
--with-png-dir=/php/php-5.5.23 \
--enable-gd-native-ttf \
--without-gdbm \
--with-gettext \
--with-gmp \
--with-iconv \
--with-jpeg-dir=/php/php-5.5.23 \
--with-openssl \
--with-pspell \
--with-pcre-regex \
--with-zlib \
--enable-exif \
--enable-ftp \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-wddx \
--with-kerberos \
--with-unixODBC=/usr \
--enable-shmop \
--enable-calendar \
--with-libxml-dir=/php/php-5.5.23 \
--enable-pcntl \
--with-imap \
--with-imap-ssl \
--enable-mbstring \
--enable-mbregex \
--with-gd \
--enable-bcmath \
--with-xmlrpc \
--with-ldap \
--with-ldap-sasl \
--with-mysql=/usr \
--with-mysqli \
--with-snmp \
--enable-soap \
--with-xsl \
--enable-xmlreader \
--enable-xmlwriter \
--enable-pdo \
--with-pdo-mysql \
--with-pear=/php/php-5.5.23/pear \
--with-mcrypt \
--without-pdo-sqlite \
--with-config-file-scan-dir=/php/php-5.5.23/php.d \
--without-sqlite3 \
--enable-intl \
--enable-opcache

make &'&' make install
mkdir /php/php-5.5.23/etc
cp -a /etc/php.ini /php/php-5.5.23/etc/php.ini

timezone=$(grep -oP '(?<'=)\w+/\w+' /etc/sysconfig/clock)
sed -i s#'date.timezone =#date.timezone = $timezone# /php/php-5.5.23/etc/php.ini

/usr/local/psa/bin/php_handler \
--add \
-displayname 5.5.23 \
-path /php/php-5.5.23/bin/php-cgi \
-phpini /php/php-5.5.23/etc/php.ini \
-type fastcgi \
-id fastcgi-5.5.23



Cette exemple est pour PHP 5.5.23, mais vous pouvez changer la version de PHP à  installer.




Souce :A https://gist.github.com/Stayallive/92e841e7dd89c8509c15



Les Catégories

Linux Serveur

Retour

Une Pub