The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP / mySQL issue

Discussion in 'General Discussion' started by GeekPatrolMille, Jul 26, 2007.

  1. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    I have had a new error pop up overnight and could use some insight from those who would be more knowledgeable than myself...

    Whenever a site with PHP is accessed I get the following error message:

    root@svr001 [/usr/lib]# tail /usr/local/apache/logs/error_log -f
    /usr/bin/php: error while loading shared libraries: libmysqlclient.so.12: cannot open shared object file: No such file or directory
    [Thu Jul 26 10:13:23 2007] [error] [client x.x.x.x] Premature end of script headers: /home/geekpat/public_html/index.php
    [Thu Jul 26 10:13:23 2007] [error] [client x.x.x.x] File does not exist: /home/geekpat/public_html/500.shtml


    I did a locate on the missing file to find:

    root@svr001 [~]# locate -v libmysqlclient.so
    /usr/local/cpanel/lib/libmysqlclient.so.14


    I have rebuilt apache a few times with different settings to try to get things back on track but no good...

    Thank you in advance...
    -greg
     
  2. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator

    Looks like something (probably your apache/php) is depending upon (i.e. compiled against) an older version of MySQL but you have a more recent vintage MySQL installed now.

    Mike
     
  3. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    Thanks Mike,

    Any ideas on how to track down the dependency and resolve? I am pretty much down for the count at this time.

    -greg
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Have you tried recompiling PHP?

    You can do this through easyapache. That should solve any dependency issues that have come about due to a MySQL upgrade or MySQL library upgrade.
     
  5. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    One additional bit of info... At a shell prompt I get the following error:

    root@svr001 [/etc]# php
    php: error while loading shared libraries: libmysqlclient.so.12: cannot open shared object file: No such file or directory


    Is there a way to rebuild PHP so the correct modules are included?

    Thanks again,
    -greg
     
  6. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    I have changed versions of PHP in easyapache and rebuilt several times. I am not getting the following messages:


    ===============SNIP===============
    ./configure [@php-4.4.7]...(--with-apxs=/usr/local/apache/bin/apxs --prefix=/usr/local --with-xml --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib).... . . . . . . . . . . . Done
    configure: error: Cannot find MySQL header files under /usr

    make [@php-4.4.7]...(-j 1 clean).... Done

    make [@php-4.4.7]...(-j 1)...Done

    make [@php-4.4.7]...(install)...Done
    /etc/rc.d/init.d/httpd start: httpd started

    ./configure [@php-4.4.7]...(--prefix=/usr --with-xml --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib).... . . . . . . . . . Done
    configure: error: Cannot find MySQL header files under /usr
    make [@php-4.4.7]...(-j 1 clean)...Done

    make [@php-4.4.7]...(-j 1)...Done

    make [@php-4.4.7]...(install)...Done
    initfpsuexec: using apache 1.x support
    PHP version file has been updated to

    ===============SNIP===============
     
  7. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    Sorry, slip of the finger... When I said NOT above, I meant to say NOW :confused:

    Thanks again...
    -greg
     
  8. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Try forcing a MySQL upgrade and then rebuilding PHP

    /scripts/mysqlup --force
     
  9. GeekPatrolMille

    GeekPatrolMille Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    McKinney, Texas, USA
    OK, it is solved...

    I updated mySQL to v4.1
    I ran /scripts/mysqlup --force
    I then rebuilt apache again... This time it actually ran through the PHP build

    Everything came up fine.

    Thank you to everyone who had suggestions... Collectively they led me to the answer I needed. :D

    -greg
     
Loading...

Share This Page