SUMMARY: Apache doesn't like PHP WITH MYSQL?

From: Ian 'Ivo' Veach <ivo_at_scsr.nevada.edu>
Date: Thu, 27 Jul 2000 13:33:27 -0700 (PDT)

This is a summary of a problem I was having a week ago. Sorry for the
delay - been pretty busy with other projects, but I did get my problem
solved. Kudos to a couple people who were close on (Simon Greaves and
David Hill), and to my compatriot Dan Rugotzke, who solved the issue
easily.

Note to other people with other systems and similar issues: Perhaps this
is why you are getting similar failures?

-------------------------------------------------------------------
The problem
-------------------------------------------------------------------

Tru64 UNIX 4.0F (OSF/1 et al), running Apache 1.3.12, trying to get PHP
4.0.01pl2 WITH MySQL (3.22.32) under Apache working. With MySQL
extensions, PHP failed (DSO and non) miserably and crypically. Non-DSO,
the server simply wouldn't start (no stdout, no log entries, no core).
DSO it gave a message:

> Syntax error on line 163 of /conf/httpd.conf:
> Cannot load /libexec/libphp4.so into server: dlopen: cannot load
> /libexec/libphp4.so
> /sbin/init.d/web_service start: httpd could not be started

that wasn't very useful. I also noted that Apache is running under a
chrooted environment, and that both the PHP and MySQL libraries had been
copied to the chroot. Finally, PHP without MySQL extensions loaded (I
tested as a DSO) and ran fine.

My questions were two: 1) Did anyone get this working on a Tru64 system
(which is why the list is getting copied this message), and 2) anyone have
any answers.

-------------------------------------------------------------------
The solution
-------------------------------------------------------------------

(prelude: The above error message was very cryptic, and recent
php-install-list reported problems have shown similar problems on other
OS's (such as Linux), but with more robust reporting features and actually
INDICATED which library was missing)

Every indication was given to specify that MySQL was in /usr/local/mysql.
Therefore, the libraries, such as libmysqlclient.so(.*) would be in
/usr/local/mysql/lib/mysql (they were actually installed into
/usr/local/lib/mysql). The problem is, Apache/PHP was not looking in
there, even though they had been configured with the specific install
path. In other words, Apache/PHP was NOT looking to
/usr/local/mysql/lib/mysql OR /usr/local/lib/mysql for the libraries,
which I can half understand (not in the std library path) and half not
(isn't that why I specified a particular directory with PHP / shouldn't it
have figured that out in install).

Anyway, I put libmysqlclient.so(.*) in /usr/local/lib (in the chroot,
and as a symbolic link to mysql/libmysqlclient.so*), and
now the PHP DSO with mysql extensions starts up and runs just dandy!

-------------------------------------------------------------------
Notes
-------------------------------------------------------------------

response -----------------------:

    I tried a similar setup (Apache 1.3.12, Oracle 8.1.5 client, PHP
4.0.01pl2) and had pretty much the same luck as you. I dropped back to PHP
3 and managed to get it running as a stop-gap, but I am still trying to get
the mix with PHP 4 working on another platform. In my case I couldn't see
that PHP3 caused any significant problems, so it's usable in my case.
    I'm currently trying to get Apache/PHP4/Oracle working on Tru64 4.0F on
a Alpha PWS-500 and a DS20. The PWS is a test bed, the DS20 is where it
will be deployed in production. We're also messing about with some Intel
boxes running RedHat Linux 6.1/6.2.

response -----------------------:

> a) Has someone else got this working on a Tru64 system? With chroot?
Not with php4, yes with php3 but not chrooted. One thing I've found
invaluable with php installs is the _RLD_ARGS environment variable (see
man loader), particularly '-interact' which causes the loader to prompt
for any shared lib it can't find - it's been invaluable when I've compiled
on one machine and then just copied binaries over to another.

response -----------------------:

Ian, I have PHP4.0.1 installed as DSO with mysql-support and everything
runs fine here. The server is Tru64 4.0E, apache V1.3.9, php V4.01 and
mysql V3.21.33b
I configured it with:
   ./configure --with-mysql
   --with-apxs=/usr/local/apache_server/apache_1.3.9/bin/apxs

HOWEVER, now I remember I had a similar error in the beginning. It turned out to be a perl problem.
I installed the latest perl and everything ran fine.

response -----------------------:

I have not done chroot, but I have pgsql support built and running with
Apache/PHP and DSO. I had to tweak the build process so that my php.so was
resolved against all of the things it needed to be resolved against (in my
case c-client.a and libpq.a). The dso library is linked with the expect
unresolved flag which might be masking a problem. Try hacking the module
build so that you explicitly link in the static library for mysql

When I was debugging this, I went into apache/src/modules/php, removed the
.so, did a make, then cut and pasted the link line removing the exprect
unresolved. I kept doing hand links until I figured out all
of the libs I needed ( -lm and -lc help reduce the unresolved count but are
not really needed as
apache is already links with those). You should be left with a handful of
ap_* unresolved. Then I put it all back together.

-------------------------------------------------------------------

Thanks again!

cheers and thanks,
________________________________________________________________________
Ian 'Ivo' Veach, ivo_at_nevada.edu UCCSN System Computing Services
http://www.nevada.edu/~ivo postmaster/webmaster/sysadmin
________________________________________________________________________
Received on Thu Jul 27 2000 - 20:34:39 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:41 NZDT