PHP
$ wget http://www.php.net/get/php-4.4.9.tar.bz2/from/de.php.net/mirror $ wget ftp://xmlsoft.org/libxml2/libxml2-sources-2.6.26.tar.gz $ wget http://www.php.net/get/php-5.2.12.tar.bz2/from/de.php.net/mirror $ wget http://www.php.net/get/php-5.3.3.tar.bz2/from/de.php.net/mirror
A hardening script describes some configurations helping to improve the security.
attention
the ZIP module is version dependant
./ext/zip/php_zip.h # if PHP_MAJOR_VERSION < 6 && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3)adujst the code if needed
fully optimized build
# CFLAGS="-march=i686 -O3 -pipe -fomit-frame-pointer -prefer-non-pic" # export CFLAGS #./configure --prefix=/opt/php-5.1.6 --with-apxs2=/opt/apache-2.0.59_12/bin/apxs --enable-module=so --with-openssl=/opt/openssl-0.9.7j --with-mysql=/opt/mysql-5.0.26 --with-mysql-sock=/tmp/mysql5.sock --without-pgsql --enable-calendar --enable-memory-limit --disable-debug --with-gd=/opt/gd-2.0.33 --enable-force-cgi-redirect --enable-magic-quotes --enable-safe-mode --enable-gd-native-ttf --with-freetype-dir=/usr/local --with-zlib --with-bz2 --with-png-dir=/opt/libpng-1.2.8 --with-jpeg-dir=/opt/jpeg-6b --with-libxml-dir=/opt/libxml2-2.6.26 --enable-mbstring --disable-ipv6 --enable-inline-optimization --disable-debug # CFLAGS=-march=prescott -O3 -pipe -fomit-frame-pointer # ./configure --prefix=/opt/php-5.2.6 --with-apxs2=/opt/apache-2.2.8/bin/apxs --with-openssl=/opt/openssl-0.9.8g --without-mysql --with-pgsql=/opt/postgresql-8.3.1 --enable-calendar --disable-debug --with-gd=/opt/gd-2.0.35 --enable-gd-native-ttf --with-freetype-dir=/opt/freetype-2.3.5 --enable-force-cgi-redirect --enable-magic-quotes --enable-safe-mode --with-zlib --enable-ftp --disable-ipv6 --enable-inline-optimization --with-libxml-dir=/opt/libxml2-2.6.32
macosx
# export CFLAGS="-DBIND_8_COMPAT=1 -DEAPI -O3" # ./configure --prefix=/opt/php-4.3.9 --without-mysql --without-pgsql --with-apxs2=/opt/apache-2.0.52/bin/apxs --enable-module=so --with-openssl=/opt/openssl-0.9.7e --enable-calendar --enable-memory-limitvserver environment
# CFLAGS="-march=k6 -O3 -pipe -fomit-frame-pointer -prefer-non-pic" # export CFLAGS # ./configure --prefix=/opt/php-4.4.6 --with-apxs2=/opt/apache-2.0.59/bin/apxs --enable-module=so --with-openssl=/opt/openssl-0.9.7j --without-mysql --with-pgsql=/opt/postgresql-7.3.9 --enable-calendar --enable-memory-limit --disable-debug --with-gd=/opt/gd-2.0.33 --enable-force-cgi-redirect --enable-magic-quotes --enable-safe-mode --enable-gd-native-ttf --with-freetype-dir=/opt/freetype-2.1.9 --with-zlib --with-png-dir=/opt/libpng-1.2.8 --with-jpeg-dir=/opt/jpeg-6b --enable-ftp --disable-ipv6 --enable-inline-optimizationand as usual
# ./make # ./make test # ./make install
configuration
The installer missed a litte but very important statement in httpd.conf
AddType application/x-httpd-php .php
this links the .php ending to the Php
module. Without this, php-code will be shown als text/plain!
web-based administration
php-based PostgreSQL administration - http://phppgadmin.sourceforge.net/
links
www.php.net -- www.php-center.de
helloworld --
Servervars Summary from ZEND the php Company
Webserver-Programmierung für Einsteiger -
PHP 4 von Thomas Theis
Offlinemanual PDF 11MByte
PHP Optimization Part 3