Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Compiling PHP from source on *nix

From TYPO3Wiki
Jump to: navigation, search

<< Back to Extension Development << Back to Developer manuals page

[edit]

Introduction

For use with caution.

Download PHP tarball from php.net

shell script:
wget http://php.net/php-5.2.6.tar.bz2

Unzip and change to PHP directory

shell script:
tar xvvjf php-5.2.6.tar.bz2
cd php-5.2.6

Get help on configuration options

shell script:
 ./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:

shell script:
./install.sh

The script:

shell 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 script:
php -r 'echo "Hello World!"'