[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-developers] Installing PHP4 as a dynamic Apache module on Cobalt RaQ3



I've seen a lot of messages regarding the aches and pains of installing PHP
on a RaQ3.  Using the RPMs always leads to trouble because it's difficult to
configure exactly where the packages will find themselves, and a person's
finger's get mighty tired typing "locate " constantly to find the shared
object libs and so on...

I've found that compiling from source code is the way to go, but before you
do a generic install, there's some things that are helpful to keep in mind:

* Always run PHP's configure script (/usr/local/php-[version]/configure)
using the "--with-apxs=[path/to/apxs].  You can find the path easily using
locate, although I think it's usually in /usr/sbin/, but I could be
mistaken.  Configuring with MySQL can be bothersome if you've installed from
an RPM because the script can't always locate the MySQL header files it
neads to successfully build the module, but leaving the dir out and using
the --with-mysql option seems to work fine on my build.

* If you run into troubles loading the module in Apache, you may receive an
error saying it can't find some shared object library or some such (eg.
libphp4.so),  If this happens, you should edit the /etc/ld.so.conf file with
vim or whatever editor and include the PHP lib directory (should be
/usr/local/php-[version]/libs), as well as the lib directories of any
additional modules.  For example, I recently recompiled with cURL support
and had to add cURL's lib directory to the file.  After it's edited, type
"ldconfig" to test your changes, then go back to the php directory and
rebuild the module by typing "make clean," then running the configuration
script again and rebuilding the module.

* If you build PHP as a dynamic module (ie, using the --with-apxs config
option), it's much easier to add new modules to PHP without having to
reconfigure the server.  Simply add the module's options to the configure
script and let it go; the next time you run <?php php_info ?>, you should
see your added functionality like magic!

I realize it might seem like a royal pain to compile from source code, but,
quite frankly, I've had much more  grief dealing with RPM files, and your
friends will think you're pretty spankin' once they see you dancing around
the command line.  If you run into any problems, I've always found webmonkey
(http://hotwired.lycos.com/webmonkey) to be a pretty good resource.

Clear as mud?  Great!

--Michael