Php53 » History » Revision 8

« Previous | Revision 8/11 (diff) | Next »
Tobias Liebig, 2008-09-06 19:02

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" assume 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 --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

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 Tobias Liebig about 13 years ago · 8 revisions