Greetings, I need help configuring/building PHP3 with MySQL as a DSO
on a Solaris 8 box - this module is needed to host some existing
sites I will be migrating
Note. I built PHP4 from source and it loads without an error.
When I try t run "apachectl configtest" I get the following error:
--
Cannot load /usr/local/apache/libexec/libphp3.so into server: ld.so.1:
/usr/local/apache/bin/httpd:
fatal: relocation error: file /usr/local/apache/libexec/libphp3.so:
symbol mysql_create_db: referenced symbol not found
I would like to know how to fix this, below are some of the many
different approaches I have tried
------
I am trying to build php-3.0.18 with Apache 1.3.31
I am using gcc 3.3.2
My configure string looks like the following
--
../configure --with-mysql=/usr/local/mysql
--with-apxs=/usr/local/apache/bin/apxs --with-xml --enable-versioning
--prefix=/usr/local/php3
------
I have tried modifying my LD_LIBRARY_PATH to include
/usr/local/mysql/lib and alternatively /usr/local/mysql/lib/mysql
I have tried configuring my run time linking environment with crle as
follows:
--
Default Library Path (ELF):
/usr/lib:/usr/local/lib:/usr/local/ssl/lib:/usr/local/mysql/lib
and alternatively
/usr/lib:/usr/local/lib:/usr/local/ssl/lib:/usr/local/mysql/lib/mysql
------
I also tried adding the following statements to the Makefile in the
APXS_LDFLAGS and LIBS definitions: "-lmysqlclient" as follows
--
APXS_LDFLAGS = -L/usr/local/lib -L/usr/local/mysql/lib/mysql
-lpam -lm -ldl -lsocket -lnsl -lresolv -lmysqlclient
LIBS = -Wl,-R'/usr/local/mysql/lib/mysql'
-L/usr/local/mysql/lib/mysql pcrelib/libpcre.a
-lpam -lm -ldl -lsocket -lnsl -lresolv -lmysqlclient
(thank you to Mika Tuupola for his posting in mailing.www.php-user)
------
if I run nm on the installed module I see a lot of unlinked calls, see
nm /usr/local/apache/libexec/libphp3.so | grep mysql
[3121]|0|0|NOTY |GLOB |0|UNDEF|mysql_affected_rows
[2974]|0|0|NOTY |GLOB |0|UNDEF|mysql_change_user
[3132]|0|0|NOTY |GLOB |0|UNDEF|mysql_close
[2895]|0|0|NOTY |GLOB |0|UNDEF|mysql_create_db
[2983]|0|0|NOTY |GLOB |0|UNDEF|mysql_data_seek
[3091]|0|0|NOTY |GLOB |0|UNDEF|mysql_drop_db
[3117]|0|0|NOTY |GLOB |0|UNDEF|mysql_errno
[2850]|0|0|NOTY |GLOB |0|UNDEF|mysql_error
[2880]|0|0|NOTY |GLOB |0|UNDEF|mysql_fetch_field
[3126]|0|0|NOTY |GLOB |0|UNDEF|mysql_fetch_lengths
[3050]|0|0|NOTY |GLOB |0|UNDEF|mysql_fetch_row
[3084]|0|0|NOTY |GLOB |0|UNDEF|mysql_field_count
[2856]|0|0|NOTY |GLOB |0|UNDEF|mysql_field_seek
[2945]|0|0|NOTY |GLOB |0|UNDEF|mysql_free_result
------
I tried modifying the apachectl script with a LD_LIBRARY_PATH
statement to include the path to the mysql libraries but that did not
work either.
If I run ldd on the installed module I get the following:
ldd /usr/local/apache/libexec/libphp3.so
libpam.so.1 => /usr/lib/libpam.so.1
libm.so.1 => /usr/lib/libm.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libresolv.so.2 => /usr/lib/libresolv.so.2
libmysqlclient.so.12 =>
/usr/local/mysql/lib/mysql/libmysqlclient.so.12
libc.so.1 => /usr/lib/libc.so.1
libcmd.so.1 => /usr/lib/libcmd.so.1
libmp.so.2 => /usr/lib/libmp.so.2
libz.so =>/usr/lib/libz.so
librt.so.1 => /usr/lib/librt.so.1
libcrypt_i.so.1 =>/usr/lib/libcrypt_i.so.1
libgen.so.1 => /usr/lib/libgen.so.1
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
libaio.so.1 => /usr/lib/libaio.so.1
/usr/platform/SUNW,Ultra-250/lib/libc_psr.so.1
So if I understand this correclty the libraries in
/usr/local/mysql/lib/mysql are being used.
Does anyone have any helpful suggestions for me?