Tedi Heriyanto
April 19, 2005
For development tools such PHP, I really like to be on the bleeding edge. When the developers release their new version, they always release it in source code version (.tar.gz or .tar.bz2). Besides, SuSE 9.2 Pro came with PHP4. So I really need to install PHP5 from source.
#!/bin/sh PHP=5.0.4 echo "Extracting $PHP" echo tar xvjpf php-$PHP.tar.bz2 cd php-$PHP echo "Configuring PHP..." echo ./configure --prefix=/usr/local/php5 --with-config-file-path=/etc/php5 \ --with-apxs2=/usr/sbin/apxs2 \ --enable-track-vars --with-gd --with-ftp \ --enable-memory-limit --with-mysql --with-pgsql --with-zlib \ --enable-soap --with-sqlite echo "Build PHP...." echo make
$ cd php-x.y.z $ su # make install # strip /usr/lib/apache2/libphp5.so # cp php.ini-dist /etc/php5/php.ini
APACHE_MODULES="... libphp5"
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php
</IfModule>
# rcapache2 restart Syntax OK Shutting down httpd2 (waiting for all children to terminate) done Starting httpd2 (prefork) done
$ pwd /home/tedi $ mkdir public_html
cat index.php <?php phpinfo(); ?>
http://localhost/~your_user/index.php
Until next time. Have a nice PHP day. :D