PHP 5.3

Building PHP 5.3 alpha1 on Debian Linux

  • Unpack source in some directory:

tar xjf php-5.3.0alpha1.tar.bz2
  • Install required debian packages for build:

apt-get install apache2-dev apache2-utils build-essential
  • If your system misses the file "/etc/apache2/httpd.conf" (like Debian/Ubuntu does) you need to create one and have at least on "LoadModule". "make install" assumes this file exists.

# make install expect at least on 
echo "LoadModule vhost_alias_module /usr/lib/apache2/modules/" >> /etc/apache2/httpd.conf
  • Install additional libraries (with dev versions -dev!), this depends on the system and configure options:

apt-get install libxml2-dev libcurl4-gnutls-dev libmcrypt-dev

  • Configure and build PHP5.3:
    The option disable-phar is necessary on some systems, otherwise the file_exists function of PHP crashes with a segmentation fault. Since FLOW3 doesn't use PHAR archives it's safe to always disable it.

./configure --with-apxs2=/usr/bin/apxs2 --with-zlib --enable-bcmath --enable-mbstring --with-mcrypt --with-mysql=mysqlnd --with-mysqli=mysqlnd --without-pear --with-curl --with-mhash --with-pdo-sqlite --with-config-file-path=/etc/php5 --disable-phar

make && make test && make install
  • If you have created the file "/etc/apache2/httpd.conf" (see above) you can remove it again now

cat /etc/apache2/httpd.conf | grep libphp5 > /etc/apache2/mods-available/php5.load
rm -f /etc/apache2/httpd.conf
  • Enable PHP5 and restart your Apache:

a2enmod php5
apache2ctl configtest 
apache2ctl restart

Hint: If the apache can't start, try to run libtool:

libtool --finish /usr/lib/apache2/modules/

Helpful Links/Tips:

Updated by Christopher Hlubek about 13 years ago ยท 11 revisions