I am trying to restart Apache on CentOS 5.7 server but am getting the following error message when I run:

service httpd restart

httpd: Syntax error on line 37 of /usr/local/apache/conf/httpd.conf: 
Syntax error on line 9 of /usr/local/apache/conf/php.conf: 
Cannot load /usr/local/apache/modules/libphp5.so into server: 
/usr/lib64/libmysqlclient.so.15: 
version `libmysqlclient_15' not found 
(required by /usr/local/apache/modules

If i remove line 9 in my php.conf file, Apache starts fine but obviously without php loaded.

I'm not very experienced with server management and have absolutely no idea where to begin diagnosing/fixing the issue and googling seems to turn up results not relevant to my situation.

Strangely everything has been working perfectly until today and I have absolutely no idea what might have caused the issue.

NOTE: This is a CentOS 5.7 x64 server using cPanel WHM

EDIT: Line 9 of my php.conf file is:

LoadModule php5_module modules/libphp5.so

I did recently upgrade my MySQL to the latest version via cPanel.

Also, I have just tried to rebuild apache using easyapache in cpanel and got the following error message:

!! 
Here are some details that may be helpful: !! '/opt/xml2/' is up to date but looks like it has local modifications. If you experience any trouble remove '/opt/xml2/' so that it will be rebuilt fresh. !! !!

And finally... The output of ldd /usr/local/apache/modules/libphp5.so is:

  /usr/local/apache/modules/libphp5.so: /usr/lib64/libmysqlclient.so.15: 
version `libmysqlclient_15' not found (required by /usr/local/apache/modules/libphp5.so)
            linux-vdso.so.1 =>  (0x00007fff9cdfd000)
            libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002aed13131000)
            libmysqlclient.so.15 => /usr/lib64/libmysqlclient.so.15 (0x00002aed1336a000)
            libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00002aed13792000)
            libssl.so.6 => /lib64/libssl.so.6 (0x00002aed13ae3000)
            libpam.so.0 => /lib64/libpam.so.0 (0x00002aed13d30000)
            libX11.so.6 => /usr/lib64/libX11.so.6 (0x00002aed13f3b000)
            libXpm.so.4 => /usr/lib64/libXpm.so.4 (0x00002aed14247000)
            libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x00002aed14459000)
            libz.so.1 => /usr/lib64/libz.so.1 (0x00002aed1467d000)
            libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00002aed14891000)
            libpcre.so.0 => /opt/pcre/lib/libpcre.so.0 (0x00002aed14ab3000)
            librt.so.1 => /lib64/librt.so.1 (0x00002aed14cee000)
            libm.so.6 => /lib64/libm.so.6 (0x00002aed14ef7000)
            libdl.so.2 => /lib64/libdl.so.2 (0x00002aed1517b000)
            libnsl.so.1 => /lib64/libnsl.so.1 (0x00002aed1537f000)
            libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00002aed15597000)
            libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00002aed157c6000)
            libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00002aed15a5b000)
            libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00002aed15c80000)
            libcurl.so.4 => /opt/curlssl/lib/libcurl.so.4 (0x00002aed15e83000)
            libidn.so.11 => /usr/lib64/libidn.so.11 (0x00002aed160dc000)
            libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00002aed1630d000)
            libc.so.6 => /lib64/libc.so.6 (0x00002aed1664b000)
            libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aed169a3000)
            libaudit.so.0 => /lib64/libaudit.so.0 (0x00002aed16bbe000)
            libXau.so.6 => /usr/lib64/libXau.so.6 (0x00002aed16dd7000)
            libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00002aed16fd9000)
            /lib64/ld-linux-x86-64.so.2 (0x0000003840e00000)
            libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00002aed171df000)
            libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00002aed173e7000)
            libresolv.so.2 => /lib64/libresolv.so.2 (0x00002aed175e9000)
            libldap-2.3.so.0 => /usr/lib64/libldap-2.3.so.0 (0x00002aed177ff000)
            libselinux.so.1 => /lib64/libselinux.so.1 (0x00002aed17a3a000)
            liblber-2.3.so.0 => /usr/lib64/liblber-2.3.so.0 (0x00002aed17c53000)
            libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x00002aed17e61000)
            libsepol.so.1 => /lib64/libsepol.so.1 (0x00002aed1807a000)

After having done as easyapache suggested I then get the following error when trying to rebuild:

!! Failed to utilize existing Apache configuration file. Resetting Apache configuration to default. !!
Updating Apache configuration
Updating Apache configuration
Distilled successfully
!! Failed to generate a syntactically correct Apache configuration (/usr/local/apache/conf/httpd.conf.1328069515):
An error occurred while running: /usr/local/apache/bin/httpd -DSSL -t -f /usr/local/apache/conf/httpd.conf.1328069515
Exit signal was: 0
Exit value was: 1
Output was:
---
httpd: Syntax error on line 28 of /usr/local/apache/conf/httpd.conf.1328069515: Syntax error on line 5 of /usr/local/apache/conf/includes/pre_main_global.conf: Cannot load /usr/local/apache/modules/mod_rpaf-2.0.so into server: /usr/local/apache/modules/mod_rpaf-2.0.so: cannot open shared object file: No such file or directory
---
!!
link|improve this question
What was line 9 of your configuration? What's the output of ldd /usr/local/apache/modules/libphp5.so? Did you recent change from a distribution-packaged MySQL to a self-compiled MySQL? – sarnold Feb 1 at 3:40
@ sarnold, please see my edits in my original question. @Ken sorry, you're absolutely right, hopefully a mod will move it sooner rather than later. I totally forgot about 'serverfault' – gordyr Feb 1 at 3:44
No problem. You got here. :) You should get help here more quickly. – Ken White Feb 1 at 3:51
how did you upgrade mysql? Did you run /scripts/mysqlup -f ? Does mysql run fine? – Chris Feb 2 at 12:51
feedback

migrated from stackoverflow.com Feb 1 at 3:48

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 1 down vote accepted

what is your current mysql version? did you try a force upgrade (/scripts/mysqlup --force) You can try this quick and ugly fix! cd /usr/lib64/ ln -s libmysqlclient.so.16 libmysqlclient.so.15 restart your apache! However as you did remove the xml file and tried to rebuil apache, now you are missing the module mod_rpaf, either you comment line 28 in /usr/local/apache/conf/includes/pre_main_global.conf or try reinstall that module.

As you use Cpanel, usually, you will find backup of all cpanel (apache/mysql/cpanel) config files at /backup/cpbackup. You may use cpanel restore option to revert the changes.

The other solution is to edit the file /var/cpanel/cpanel.conf find the line about mysql version (mysql_version=5.1 or something like that) change the version to the original one, save, run /scripts/mysqlup --force

Let us know!

link|improve this answer
Fantastic... Thank you! So simple when you know how! Great answer cheers! – user6595 Feb 4 at 8:41
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.