13mai2009
Compilation Installation et Configuration Php

C'est par ici les amis...
Pré requis :
Cet article va de paire avec celui sur l'installation d'apache2
Téléchargement php:
Prenez la dernière version stable.
http://www.php.net/downloads.php
cd /opt/SOURCES wget http://fr.php.net/get/php-5.2.9.tar.bz2/from/this/mirror mkdir /opt/php529 cd /opt ln -s /opt/php529 php
Compilation :
Faites bien attention aux options dont vous aurez besoin pour vos sites et applications.
cd /opt/SOURCES/php-5.2.9 ./configure --help ./configure --prefix=/opt/php --with-apxs2=/opt/httpd/bin/apxs --with-zlib=/usr --with-gd=/opt/gd --with-jpeg-dir=/usr/lib64 --with-mysql=/opt/mysql --enable-sigchild --enable-calendar --enable-ftp --with-openssl --with-snmp=/usr --enable-mbstring --with-mcrypt --with-gettext=/usr/lib64 --with-pdo-mysql=/opt/mysql5126 --with-zlib-dir=/usr/include --with-png-dir=/usr/include make make test make install
La ligne de compilation est biensur à adapté selon votre environnement et vos installations d'apache, mysql etc...
Configuration :
Le fichier php.ini
cp /opt/SOURCES/php-5.2.6/php.ini-dist /opt/php526/lib/php.ini
L'environnement
vi /etc/profile pathmunge /opt/php/bin vi /etc/ld.so.conf /opt/php/lib
Ajout pour apache2 :
Ce qui suit est à ajouter dans votre httpd.conf.
DirectoryIndex index.html index.htm index.php index.php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Vérifier aussi la presence de cette ligne dans votre httpd.conf
LoadModule php5_module modules/libphp5.so
Si vous désirez approfondir et sécurisé la configuration de votre php lisez cet article sur le php.ini
