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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pancho@acadia.net

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

    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?

  • Gary L. Burnore

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

    On Fri, 25 Jun 2004 11:28:21 -0400, pancho@acadia.n et wrote:
    [color=blue]
    >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.
    >[/color]
    Solaris 8 for Intel or Sparc?

    [color=blue]
    >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[/color]

    Why not Apache2? Just curious.
    [color=blue]
    >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[/color]

    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@databa six 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
    =============== =============== =============== =============== ===============

    Comment

    • pancho@acadia.net

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

      On Fri, 25 Jun 2004 12:27:59 -0400, Gary L. Burnore
      <gburnore@datab asix.com> wrote:
      [color=blue]
      >On Fri, 25 Jun 2004 11:28:21 -0400, pancho@acadia.n et wrote:
      >[color=green]
      >>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.
      >>[/color]
      >Solaris 8 for Intel or Sparc?
      >
      >[color=green]
      >>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[/color]
      >
      >Why not Apache2? Just curious.
      >[color=green]
      >>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_LDFLAG S and LIBS definitions: "-lmysqlclient" as follows[/color]
      >
      >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[/color]
      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

      and the postings at the bottom of this page

      Comment

      Working...