AlanBarber.Org
Sunday, September 19, 2004
FreeBSD PHP Ports Changes
It’s actually pretty old news I guess but I just got around to doing some updating on my FreeBSD installation today and found out some major changes have been made to the way PHP is now installed.
It used to be that you could do an install of php “/usr/ports/www/mod_php4> make install clean” and a menu would come up to lets you select the extensions to install. IE… support for mysql, session, xml, etc.
However now there are no options and you will get only a default base install.
To install the extensions you either have to do each one manually by finding them spread out around the ports tree. MySQL support is in “/usr/ports/databases/php4-mysql” for example. The easier way is to use the new php extension meta-port in “/usr/ports/lang/php4-extensions”. doing an “install” of this port will show the menu where you can select all the extensions then it will go out and do installs of all the extensions.
The notices are in the /usr/ports/CHANGES and /usr/ports/UPDATING dated July 17th, 2004. Just thought I’d point this out since I’m sure there will be a few folks to miss this like I did. Yes I know I should read the CHANGES and UPDATING files but like 90% of people I just run the updates on the ports and don’t check out things until something doesn’t work right!
** UPDATE (9/20/2004) **
Ok even after running the php4-extensions meta-port the modules were still not loading. After spending this morning searching the web I managed to figure out that the problem is the php.ini file has a misconfigured “extension_dir”. It appears default is set to “./” where as for php4 the actual location is “/usr/local/lib/php/20020429”.
If you look in the php.ini file found in “/usr/local/etc” for these lines:
; Directory in which the loadable extensions (modules) reside.
extension_dir = “./”
You can either comment out the extension_dir line by putting a semicolon before it or change the “./” to “/usr/local/lib/php/20020429”. A quick restart of apache and you should be good to go.
Thanks from me too, top work
Man, I’ve been working on this problem all day. I came to the same solution independantly. Wish I found your post yesterday!
on 09/19/2004 at 04:30 PM
THANK YOU! Your update there has just saved me countless hours of using vi over a dialup connection at Christmas. I salute you, good sir.