By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,742 Members | 1,570 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,742 IT Pros & Developers. It's quick & easy.

Need help building PHP3 with MySQL as DSO on Solaris 8, PHP4 + MySQL built and loads fine

P: n/a
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?

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Fri, 25 Jun 2004 11:28:21 -0400, pa****@acadia.net wrote:
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.
Solaris 8 for Intel or Sparc?

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
Why not Apache2? Just curious.
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


The order you do this stuff is important:

build a base of apache and install it
build mysql and install it
build php with your config settings and install
rebuild apache telling it where mysql and php are.

Depending on if it's Solaris for Intel or Sparc, you can find some
pre-compiled stuff at www.sunfreeware.com
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
DataBasix | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ۳
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://www.databasix.com
================================================== =========================
Jul 17 '05 #2

P: n/a
On Fri, 25 Jun 2004 12:27:59 -0400, Gary L. Burnore
<gb******@databasix.com> wrote:
On Fri, 25 Jun 2004 11:28:21 -0400, pa****@acadia.net wrote:
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.

Solaris 8 for Intel or Sparc?

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


Why not Apache2? Just curious.
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


The order you do this stuff is important:

build a base of apache and install it
build mysql and install it
build php with your config settings and install
rebuild apache telling it where mysql and php are.

Depending on if it's Solaris for Intel or Sparc, you can find some
pre-compiled stuff at www.sunfreeware.com

I built on SPARC, and used Apache 1.3.31 rather than 2 as I am using
OpenSSL and cURL and a few other tricks, and I will have to set up an
instance of Apache to use FrontPage as well for some of my userbase (I
would like to avoid that but it isn't possible) and I am familiar with
this version of Apache as I have been working with it for 10 years
I am building PHP to load as dynamic modules so I can match what my
subscribers need by editing httpd.conf, and have several instances of
apache running on the same box. This is also a great idea for if one
server dies not all the customers are equally affected.
I built Apache, then installed Openssl And Openssh, and cURL, then
MySQL. I built and installed PHP4 without any issues at all. I cannot
seem to get PHP3 to link in everything on the build
Some other people have had this problem, see
http://groups.google.com/groups?hl=e...%3Dng%26sa%3DN
and the postings at the bottom of this page
http://www.php.net/manual/en/install.solaris.php
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.