PHP kompilieren

Früher oder später passiert es jedem Entwickler: es fehlen PHP-Module, ein Debugger soll integriert werden oder es wir eine bestimmte Funktion in PHP benötigt. Dann hilft nur eines: PHP muss kompiliert werden. Das ist einfacher, als es aussieht.

configure Aufruf auf Debian sarge

Die Kompilierung für Debian ist auf dem Standardsystem noch nicht möglich.

Mögliche Fehlermeldungen bei dem Versuch sind:

configure: error: no acceptable cc found in $PATH

configure: error: installation or configuration problem: C compiler cannot create executables.

configure: error: installation or configuration problem: C compiler cannot create executables.

configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/

checking lex output file root... ./configure: line 2540: lex: command not found

configure: error: Cannot find MySQL header files

Damit es dazu nicht kommt müssen erst einige Entwicklungs-Werkzeuge installiert werden (daher nicht auf einem Produktivsystem!):

TAKAMOTU:/usr/src/php/php-4.4.4# apt-get install php4-dev libxml2 autoconf2.13 autobook autoconf-archive gnu-standards gcc linux-kernel-headers libc6-dev flex apache2-dev curl libcurl3-dev libmysqlclient14-dev

Nach erfolgreichem configure wird die folgende Meldung angezeigt:

 

TAKAMOTU:/usr/src/php/php-4.4.4# ./configure --enable-mbstring --with-xml --with-pear=/usr/share/php --with-curl --with-openssl=/usr --with-zlib --with-mysql --prefix=/usr --with-apxs2=/usr/bin/apxs2 --with-config-file-path=/etc/php4/apache2 --enable-memory-limit --with-regex=php --with-layout=GNU --enable-track-vars --with-iconv --with-pcre-regex=/usr --with-mime-magic=/usr/share/misc/file/magic.mime --with-exec-dir=/usr/lib/php4/libexec

configure Aufruf php4 auf PowerBook

Hier mein configure-Aufrufe auf dem Mac für php4:

'/SourceCache/apache_mod_php/apache_mod_php-18.8/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--with-apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' '--with-mysql=/usr' '--with-mysql-sock=/var/mysql/mysql.sock' '--without-pear'

configure-Aufruf für php5 auf PowerBook

Hier mein configure-Aufruf für php5 auf dem Mac:

./configure --prefix=/usr/local --with-apxs=/usr/sbin/apxs --sysconfdir=/private/etc --enable-sockets --enable-cli --disable-cgi --enable-ftp --enable-mbstring --enable-mbregex --with-libxml-dir=/sw --with-xsl=/sw --with-gd --with-png-dir=/sw --with-jpeg-dir=/sw --with-freetype-dir=/sw/lib/freetype2 --enable-gd-native-ttf --with-t1lib=/sw --with-ldap=/usr --with-kerberos=/usr --with-zlib-dir=/usr --with-mysql=/sw --with-mysql-sock=/var/mysql/mysql.sock --with-pdo-mysql=/sw --with-iconv --enable-sqlite-utf8 --with-pdflib=/Users/akira/PDFlib-7.0.0-MacOSX-PowerPC/bind/c --with-pear --enable-soap --with-mcrypt=/sw