Zuerst die aktuelle Version (aktuell 5.2.5) als Quelltext besorgen und entpacken:
wget http://de3.php.net/get/php-5.2.5.tar.gz/from/this/mirror
tar -zxvf php-5.2.5.tar.gz
cd php-5.2.5
tar -zxvf php-5.2.5.tar.gz
cd php-5.2.5
ein
./configure --help
liefert viele Informationen zu Verfügbaren Extesions die mit reinkompilierung werden können, z.b:
--with-EXTENSION=[shared[,PATH]]
NOTE: Not all extensions can be build as 'shared'.
Example: --with-foobar=shared,/usr/local/foobar/
o Builds the foobar extension as shared extension.
o foobar package install prefix is /usr/local/foobar/
--disable-all Disable all extensions which are enabled by default
--disable-libxml Disable LIBXML support
--with-libxml-dir[=DIR] LIBXML: libxml2 install prefix
--with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6)
--with-kerberos[=DIR] OPENSSL: Include Kerberos support
--without-pcre-regex Do not include Perl Compatible Regular Expressions support.
DIR is the PCRE install prefix [BUNDLED]
--with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)
--with-zlib-dir=<DIR> Define the location of zlib install directory
--enable-bcmath Enable bc style precision math functions
--with-bz2[=DIR] Include BZip2 support
--enable-calendar Enable support for calendar conversion
--disable-ctype Disable ctype functions
--with-curl[=DIR] Include cURL support
--with-curlwrappers Use cURL for url streams
--enable-dba Build DBA with bundled modules. To build shared DBA
extension use --enable-dba=shared
--with-qdbm[=DIR] DBA: QDBM support
--with-gdbm[=DIR] DBA: GDBM support
--with-ndbm[=DIR] DBA: NDBM support
--with-db4[=DIR] DBA: Berkeley DB4 support
--with-db3[=DIR] DBA: Berkeley DB3 support
--with-db2[=DIR] DBA: Berkeley DB2 support
--with-db1[=DIR] DBA: Berkeley DB1 support/emulation
--with-dbm[=DIR] DBA: DBM support
--without-cdb[=DIR] DBA: CDB support (bundled)
--disable-inifile DBA: INI support (bundled)
--disable-flatfile DBA: FlatFile support (bundled)
--enable-dbase Enable the bundled dbase library
--disable-dom Disable DOM support
--with-libxml-dir[=DIR] DOM: libxml2 install prefix
--enable-exif Enable EXIF (metadata from images) support
--with-fbsql[=DIR] Include FrontBase support. DIR is the FrontBase base directory
--with-fdftk[=DIR] Include FDF support
--disable-filter Disable input filter support
--with-pcre-dir FILTER: pcre install prefix
--enable-ftp Enable FTP support
--with-openssl-dir[=DIR] FTP: openssl install prefix
--with-gd[=DIR] Include GD support. DIR is the GD library base
install directory [BUNDLED]
NOTE: Not all extensions can be build as 'shared'.
Example: --with-foobar=shared,/usr/local/foobar/
o Builds the foobar extension as shared extension.
o foobar package install prefix is /usr/local/foobar/
--disable-all Disable all extensions which are enabled by default
--disable-libxml Disable LIBXML support
--with-libxml-dir[=DIR] LIBXML: libxml2 install prefix
--with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6)
--with-kerberos[=DIR] OPENSSL: Include Kerberos support
--without-pcre-regex Do not include Perl Compatible Regular Expressions support.
DIR is the PCRE install prefix [BUNDLED]
--with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)
--with-zlib-dir=<DIR> Define the location of zlib install directory
--enable-bcmath Enable bc style precision math functions
--with-bz2[=DIR] Include BZip2 support
--enable-calendar Enable support for calendar conversion
--disable-ctype Disable ctype functions
--with-curl[=DIR] Include cURL support
--with-curlwrappers Use cURL for url streams
--enable-dba Build DBA with bundled modules. To build shared DBA
extension use --enable-dba=shared
--with-qdbm[=DIR] DBA: QDBM support
--with-gdbm[=DIR] DBA: GDBM support
--with-ndbm[=DIR] DBA: NDBM support
--with-db4[=DIR] DBA: Berkeley DB4 support
--with-db3[=DIR] DBA: Berkeley DB3 support
--with-db2[=DIR] DBA: Berkeley DB2 support
--with-db1[=DIR] DBA: Berkeley DB1 support/emulation
--with-dbm[=DIR] DBA: DBM support
--without-cdb[=DIR] DBA: CDB support (bundled)
--disable-inifile DBA: INI support (bundled)
--disable-flatfile DBA: FlatFile support (bundled)
--enable-dbase Enable the bundled dbase library
--disable-dom Disable DOM support
--with-libxml-dir[=DIR] DOM: libxml2 install prefix
--enable-exif Enable EXIF (metadata from images) support
--with-fbsql[=DIR] Include FrontBase support. DIR is the FrontBase base directory
--with-fdftk[=DIR] Include FDF support
--disable-filter Disable input filter support
--with-pcre-dir FILTER: pcre install prefix
--enable-ftp Enable FTP support
--with-openssl-dir[=DIR] FTP: openssl install prefix
--with-gd[=DIR] Include GD support. DIR is the GD library base
install directory [BUNDLED]
Für die meisten wird folgendes absolut ausreichend sein:
./configure --prefix=<<installations verzeichniss>> --with-config-file-path=<<verzeichniss wo php.ini liegt>> --with-regex=php --with-zlib --with-gd --enable-ftp --with-mysql --with-mysqli --with-pdo-mysql --without-pear
kommt dabei irgendwo ein “configure: error: no acceptable ***”, fehlt etwas auf deinem System um die installation durchzuführen.
Nach der Konfiguration, wird nun PHP installiert.
make && make install
Fertig ist die Installation, nun noch die Webserverkonfiguration anpassen und tada, das neue PHP sollte laufen