Operating System - Linux
1830211 Members
3101 Online
109999 Solutions
New Discussion

Re: MySQL, PHP, and Apache

 
SOLVED
Go to solution
Vernon Brown_4
Trusted Contributor

MySQL, PHP, and Apache

I upgraded from Fedora C1 to C3 on my old HP 8500 Pavilion that serves as a gateway to the internet for my LAN. I have MySql, Apache2, and PHP5 installed and was using them together successfully to run a PHPbb forum with C1. With C3, now, I can't get PHP, and MySQL to connect. When users attempt to connect to the forum http://cabot-biz.com/phpbb/ we get a no-socket error.

The mysql.sock it's looking for in /tmp is not there. mysqld is running as user mysql same as before.

The upgrade to C3 changed the Apache2 php.conf to load libphp4.so instead of libphp5.so That copy of libphp4.so was not compiled to play with MySQL. I commented out that line and inserted the one for libphp5.so.

With libphp4.so, I got a blank page, with libphp5.so I get the error message when trying to connect.

I need to figure out what puts the mysql.sock in place I think.
4 REPLIES 4
Alex Lavrov.
Honored Contributor

Re: MySQL, PHP, and Apache

This link might help you:
http://www.experts-exchange.com/Databases/Mysql/Q_20828830.html

Look at the bottom after all the comercials.


And this might help too:
http://forums.devshed.com/showpost.php?p=971069&postcount=15
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Vernon Brown_4
Trusted Contributor

Re: MySQL, PHP, and Apache

Thanks the sites were useful but still no joy. I tried some of the suggested things like:
]# bin/mysqladmin create forum
bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
[root@veb mysql]# ps -A | grep mysql
4401 pts/0 00:00:00 mysqld_safe
4434 pts/0 00:00:00 mysqld
4435 pts/0 00:00:00 mysqld
4436 pts/0 00:00:00 mysqld
4437 pts/0 00:00:00 mysqld
4438 pts/0 00:00:00 mysqld
4439 pts/0 00:00:00 mysqld
4440 pts/0 00:00:00 mysqld
4441 pts/0 00:00:00 mysqld
4442 pts/0 00:00:00 mysqld
4443 pts/0 00:00:00 mysqld
[root@veb mysql]# netstat -l | grep mysql
tcp 0 0 *:mysql *:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 20413 /var/lib/mysql/mysql.sock
[root@veb mysql]#

mysql doesn't seem to be listening on /tmp/mysql.sock

Alex Lavrov.
Honored Contributor
Solution

Re: MySQL, PHP, and Apache

Yes, because it seems that it's using "/var/lib/mysql/mysql.sock" instead of "/tmp/mysql.sock"


Did you try to disable SELinux security for the httpd daemon?
(http://forums.mysql.com/read.php?11,9689,21483)

You also can try this:
http://sunsite.mff.cuni.cz/MIRRORS/ftp.mysql.com/doc/en/Problems_with_mysql.sock.html

It seems that your client and server are using different sockets to connect. I'm sure that if you'll follow the instruction in the second link, it will work.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Vernon Brown_4
Trusted Contributor

Re: MySQL, PHP, and Apache

Thanks for the links Alex; that last one nailed it. It was a config problem in the file /etc/my.cnf pointing to the wrong database.