Compiling PHP from source on *nix
From TYPO3Wiki
<< Back to Extension Development << Back to Developer manuals page
Contents |
Introduction
For use with caution.
Download PHP tarball from php.net
wget http://php.net/php-5.2.6.tar.bz2
Unzip and change to PHP directory
tar xvvjf php-5.2.6.tar.bz2 cd php-5.2.6
Get help on configuration options
./configure --help
Add the needed options to an install script (see below for an example). This script will be called install.sh from here on.
Run installation script:
./install.shThe script:
#!/bin/sh mkdir /usr/share/php5 sh configure --prefix=/usr --datadir=/usr/share/php5 --mandir=/usr/share/man --bindir=/usr/bin --with-libdir=lib --inc ludedir=/usr/include --sysconfdir=/etc/php5/apache2 --with-config-file-path=/etc/php5/apache2 --with-config-file-scan- dir=/etc/php5/conf.d --with-exec-dir=/usr/lib/php5/bin --enable-libxml --enable-filter --enable-session --with-mm --wi th-pcre-regex=/usr --enable-xml --enable-simplexml --enable-spl --disable-debug --enable-memory-limit --enable-inline- optimization --enable-zend-multibyte --disable-rpath --with-apxs2=/usr/sbin/apxs2 --disable-all --enable-cli --with-z lib --with-curl --enable-mbstring make make install rm /usr/lib/apache2/mod_php5.so ln -sf /usr/lib/apache2/libphp5.so /usr/lib/apache2/mod_php5.so sudo sh /usr/sbin/apache2ctl restart
Test PHP
php -r 'echo "Hello World!"'