Source Rally PHP Community Scripts .. Sign up .. Login
I have just been updating the PHP version on a clients server, they had been using ports to install PHP. Unfortunately I have little experience with Freebsd and did not find a quick guide on how to do this using google.

So here's what I did, I hope somebody will find it usefull.

#1 Updating the ports database, command line.
$ portsnap fetch
$ portsnap extract

Now open the file: /usr/ports/lang/php5/Makefile in your editor of choice and make sure to include the libraries you need in the CONFIGURE_ARGS . Mine ended up looking like this (between other I had to remove --disable-all which means no session support among others):
--------------------------------------------
CONFIGURE_ARGS=    \
        --with-layout=GNU \
        --with-config-file-scan-dir=${PREFIX}/etc/php \
        --enable-libxml \
        --with-mysql \
        --with-libxml-dir=${LOCALBASE} \
        --enable-reflection \
        --program-prefix=""
--------------------------------------------

Continue command line:
$ cd /usr/ports/lang/php5/
$ make
$ make deinstall
(the last line removes the old installation of PHP)
$ make reinstall
$ httpd -k restart

And you are done.

***EDIT***

If you need to configure the PHP-install later, remember to use:
$ make clean

Sign up to add your own comment here!

All user contributed content is available under the unless specified otherwise.
Remaining copyrights Regin Gaarsmand 2006-2008
About www.SourceRally.net