Serveur Web avec plusieurs versions de php

sources phpfarm:http://museum.php.net/php5/

apt-get install apache2 php5 build-essential mysql-client libmysql++-dev libxml2-dev libcurl4-openssl-dev libpng-dev libicu-dev libmcrypt-dev libxslt-dev libssl-dev
./configure -prefix=/usr/local/php56 -with-config-file-path=/usr/local/php56/etc/php/ -disable-ipv6 -with-curl -enable-ftp -with-gd -enable-intl -enable-mbstring -with-mcrypt -with-pdo-mysql=mysqlnd -enable-soap -with-xsl -with-zlib -with-openssl -with-pear=/usr/local/php56/share/php -with-mysql

Configuration:

Lancez la compilation de la version de php souhaitée:
/opt/phpfarm/src# ./compile.sh 7.0.0

nano /etc/apache2/sites-available/default

        ServerAdmin webmaster@localhost

        DocumentRoot /var/www

        
                Options FollowSymLinks
                AllowOverride None
        
        
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all

        
# Pour les sites en 5.3.2
        
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        AddHandler php-cgi .php
        Action php-cgi /cgi-bin-php/php-cgi-5.3.2

    <FilesMatch "\.php$">
      SetHandler php-cgi
    
        
# Pour les sites en 5.4.0
        
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        AddHandler php-cgi .php
        Action php-cgi /cgi-bin-php/php-cgi-5.4.0

    <FilesMatch "\.php$">
      SetHandler php-cgi
    
        
# Pour les sites en 5.6.9
        
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        AddHandler php-cgi .php
        Action php-cgi /cgi-bin-php/php-cgi-5.6.9

    <FilesMatch "\.php$">
      SetHandler php-cgi
    
        

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

mkdir /var/www/cgi-bin

nano /var/www/cgi-bin/php-cgi-7.0.0

#!/bin/sh
PHPRC="/opt/phpfarm/inst/php-7.0.0/bin/"
export PHPRC

PHP_FCGI_CHILDREN=3
export PHP_FCGI_CHILDREN

PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS

exec /opt/phpfarm/inst/bin/php-cgi-7.0.0
Ce contenu a été publié dans Debian, Informatique, Serveurs, avec comme mot(s)-clé(s) , , , , . Vous pouvez le mettre en favoris avec ce permalien.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *