radaway
(usa Ubuntu)
Enviado em 13/07/2016 - 18:07h
tudo como root
apt-get install -y build-essential libbz2-dev libxpm-dev libmcrypt-dev libcurl4-openssl-dev libxml2-dev libjpeg-dev libpng12-dev libreadline-dev libedit-dev firebird-dev php-dev
apt-get install -y aspell libaspell-dev libxml2 libsnmp-base libsnmp30 libxml2-dev libbz2-dev libzip-dev libzip4 zlib1g zlib1g-dev curl libcurl4-openssl-dev libcurl3 libcurl3-gnutls libc-client-dev libfreetype6 libfreetype6-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev libmcrypt-dev libmcrypt4 libtidy-dev libxslt1-dev
baixe o pacote do php 5.3.29 e faça sua extração,
dentro do diretorio do php:
make clean
./configure --prefix=/usr/share/php53 --datadir=/usr/share/php53 --mandir=/usr/share/man --bindir=/usr/bin/php53 --includedir=/usr/include/php53 --sysconfdir=/etc/php53/apache2 --with-config-file-path=/etc/php53/apache2 --with-config-file-scan-dir=/etc/php53/conf.d --enable-bcmath --with-curl=shared,/usr --with-mcrypt=shared,/usr --enable-cli --with-gd --enable-libxml --enable-session --enable-xml --enable-simplexml --enable-filter --enable-inline-optimization --with-jpeg-dir --with-png-dir --with-zlib --with-bz2 --enable-exif --enable-soap --with-pic --disable-rpath --disable-static --enable-shared --with-gnu-ld --enable-mbstring --enable-calendar --enable-zip --with-mhash --enable-dba --enable-ftp --with-gettext --enable-shmop --enable-sockets --enable-sysvmsg --enable-wddx --enable-sysvsem --enable-sysvshm --enable-fpm --enable-pcntl
make
make install
update-alternatives --install /usr/bin/php php /usr/bin/php53/php 53
update-alternatives --install /usr/bin/phpize phpize /usr/bin/php53/phpize 53
update-alternatives --install /usr/bin/php-config php-config /usr/bin/php53/php-config 53
update-alternatives --set php $(update-alternatives --list php | grep 53)
update-alternatives --set phpize $(update-alternatives --list phpize | grep 53)
update-alternatives --set php-config $(update-alternatives --list php-config | grep 53)
Arquivo /etc/init.d/php5.3-fpm
#! /bin/sh
### BEGIN INIT INFO
# Provides: php-fpm
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: This file starts and stops PHP-FPM
#
### END INIT INFO
SCRIPT_NAME="/etc/init.d/php5.3-fpm"
PHP_DIR="/usr/share/php53/sbin"
PHP_CONF="/etc/php53/apache2/php-fpm.conf"
PHP_PIDFILE="/run/php/php5.3-fpm.pid"
FPM_PID=$(ps aux | grep "master process (/etc/php53/apache2/php-fpm.conf)" | grep -v grep | awk '{print $2}')
case "$1" in
start)
if [ ! -z "${FPM_PID}" ]; then
echo "PHP5.3-FPM já esta em execução"
exit 2
fi
if [ -e "${PHP_PIDFILE}" ]; then
echo "pidfile não removido ${PHP_PIDFILE} "
exit 2
fi
echo "Iniciando PHP5.3-FPM.... "
${PHP_DIR}/php-fpm --daemonize --fpm-config ${PHP_CONF}
;;
stop)
if [ -z "${FPM_PID}" ]; then
echo "PHP5.3-FPM não esta em execução"
exit 2
fi
echo "Parando PHP5.3-FPM... "
kill -9 ${FPM_PID} $(pstree -p ${FPM_PID} | sed 's|.*(||g' | sed 's|)||g' | tr '\n' ' ')
rm -rf ${PHP_PIDFILE}
;;
restart)
${SCRIPT_NAME} stop
sleep 3
${SCRIPT_NAME} start
;;
*)
echo "Usage: php-fpm {start|stop|restart}" >&2
exit 3
;;
esac
adicionar na inicialização
chmod +x /etc/init.d/php5.3-fpm
update-rc.d php5.3-fpm defaults
editar /etc/php53/apache2/fpm.d/www.conf
alterar o listen para
listen = /run/php/php5.3-fpm.sock
criar o diretorio /run/php e dar permisssões
instalar no apache
apt-get install -y apache2 libapache2-mod-fastcgi
habilitar
a2enmod actions
criar /etc/apache2/conf-available/fastcgi.conf com:
FastCgiExternalServer /var/www/html/php5.3.external -socket /run/php/php5.3-fpm.sock -idle-timeout 12000 -pass-header Authorization
Action php5.3-fcgi /usr/lib/cgi-bin/php5.3.external
Alias /usr/lib/cgi-bin/ /var/www/html/
Habilitar a conf
a2enconf fastcgi
No teu vhost
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler php5.3-fcgi
</FilesMatch>
se precisar compilar mais modulos que estão na pasta ext do pacote do php
cd ext
DIRS=(interbase pgsql xmlrpc pdo pdo_firebird pdo_pgsql readline)
for i in ${DIRS[@]}; do
cd ${i}
make clean
phpize
./configure
make
make install
cd ..
done
adicionar no php.ini o load dos modulos compilados depois
EX:
extension=interbase.so