Installation of PHP with Secureweb-SSL and Databases
Problem: You installed RedHat's SecureWeb and mod_php3 using RPMS, but it wasn't compiled with the database support you need!
Even though it comes with mod_php on the CDROM, if you ask anything
about it from the RedHat "intallation techincal support"
you find its useless.
REALLY useless.
Solution:
Currently the RPM packagers are setting up the RPMS to install without database support.
You need to tell the RPM spec file which databases to support and the location of the top-level of your database server.
This example will explain the process of adding support for the popular MySQL and Msql database servers, using the mod installation for Apache.
Of course all of this information can be adjusted for any database server that PHP3 supports.
I will assume you installed MSQL and MySQL with or without RPMS but have installed
MSQL into /usr/local/Hughes.
Note: the version you have to use (libc6 or libc5) depends on
what version of RedHat you are using. Check with the RedHat errata to
make sure you use the correct rpm.
- First if you had rolled your own server into /etc/httpd and
had a secure server in /etc/httpsd then get ready
to have both your current setup hosed as well as the old SSL setup.
When RedHat SSL-server
version 1 came out it first went into /etc/httpsd, now it goes
in /etc/httpd, creates some soft links there and rpmsaves /etc/httpsd
so backup the whole directory.
cp -r /etc/httpd/conf /etc/httpd/conf.ok
- Then install the secureweb packages
rpm -Uvh secureweb-2.0-3libc6.i386.rpm
rpm -Uvh secureweb-source-2.0-3libc6.i386.rpm
rpm -Uvh secureweb-devel-2.0-3libc6.i386.rpm
Gotcha: This adds a bunch of *.h files
to /usr/include/apache , so if you were planning on
building a newer version of Apache_PHP make sure
you don't specify /usr/include/apache
as the include dir when you compile Apache/PHP.
- Then remove mod_php3
rpm -e mod_php3
- Then get the source php rpm and INSTALL it, NOT --rebuild
rpm -Uvh mod_php3-3.0.5-2.src.rpm
- Then edit the /usr/src/redhat/SPECS/mod_php3*.spec file
In the %build section add the database support you want, and the path.
For MySQL you would add --with-mysql=/usr \
The %build section will look something like this:
./configure --prefix=/usr \
--with-apxs=/usr/sbin/apxs \
--with-config-file-path=/usr/lib \
--enable-debug=no \
--enable-safe-mode \
--with-exec-dir=/usr/bin \
--with-mysql=/usr \
--with-msql \
--with-system-regex
- Once this modification is made then build the binary rpm as follows:
rpm -bb /usr/src/redhat/SPECS/mod_php3.spec
- Then install the rpm
rpm -ivh --excludedocs /usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm
If you get a warning about requiring libgd and you already have it installed
then ignore the error and go ahead and install it using the flag --nodeps.
Make sure you restart Apache, and you now have PHP with MySQL support using RPM's.
RTFM about uncommenting the AddHandler and AddModule lines in httpd.conf
Credits
This is based on the FAQ written by Jim Winstead.
|