Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed MySQL and PHP, and I tried restarting apache and here what happens when I run # service httpd restart:

Stopping httpd: [FAILED]

Starting httpd: httpd: Syntax error on line 17 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /usr/lib64/libmysqlclient.so.18: file too short

I have spent the whole day trying to solve it, reinstalled MySQL a couple of times, as well as PHP, and still nothing.

When I run # ldconfig -v |grep mysql, here is what I get:

libmysqlclient.so.16 -> libmysqlclient.so.16.0.0

libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0

ldconfig: Cannot stat /usr/lib/libltdl.so: No such file or directory

ldconfig: File /usr/lib64/libmysqlclient.so.18 is empty, not checked.

libmysqlclient.so.16 -> libmysqlclient.so

libmysqlclient.so.15 -> libmysqlclient.so.15

Oviously, there is an error with libltdl.so file, but I don't think it matters in this case. I'm more concerned with libmysqlclient.so.18. The file exists but it's empty, and I suspect that's why the error appears when I try to start httpd.

Please help, I'm going insane...

PHP Version:

PHP 5.4.11 (cli) (built: Feb 16 2013 08:42:08) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

MySQL-devel version:

mysql-devel-5.1.67-1.el6_3.x86_64

EDIT After copying the source libmysqlclient.so.18 to the directory, the error changed to:

Starting httpd: httpd: Syntax error on line 17 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: undefined symbol: client_errors

share|improve this question
    
did you install apache,php,mysql from prebuilt packages or from source? –  Daniel t. Feb 17 '13 at 1:02
    
VPS came with everything installed. However, I reinstalled PHP and MySQL myself, for the never versions. I installed PHP from Git, and MySQL via YUM –  Lukas Bijaminas Feb 17 '13 at 1:08
    
can you update your question with the php and mysql-devel version you have installed? run php -v and rpm -aq |grep mysql-dev? The problem you are facing could be due to php compiled to the wrong verson of mysql library. –  Daniel t. Feb 17 '13 at 1:14
    
Just updated the post –  Lukas Bijaminas Feb 17 '13 at 1:31
    
Where did you get that version of PHP? –  Michael Hampton Feb 17 '13 at 1:31

1 Answer 1

Try this:

yum whatprovides */libmysqlclient.so

Remove and reinstall the package related to it (should be mysql-something).

share|improve this answer
    
I have done it before when reinstalling MySQL, and it did now, but still no change. –  Lukas Bijaminas Feb 17 '13 at 0:14
    
I would grab the exact RPM it's installing, and unpack it, then manually try to copy over libmysqlclient.so.18 and see if that works. If it does, you can go from there. –  Jay Feb 17 '13 at 0:16
    
I did it, and the error changed to: Starting httpd: httpd: Syntax error on line 17 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: undefined symbol: client_errors –  Lukas Bijaminas Feb 17 '13 at 0:27
    
Did you try recompiling PHP? Sounds like you are mixing and matching RPMs and source. –  Jay Feb 17 '13 at 12:15
1  
I reinstalled Apache along with many other libraries, and now everything is working –  Lukas Bijaminas Feb 17 '13 at 17:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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