| Index
» Projekty
» phpMyEdit
» Fórum
» cannot connect |
 |
aceaid
Založený: 08.10.2008
Príspevky: 3
Zaslal: 2008-10-08 21:10
Návrat hore
Odpovedať s citátom
|
php 5.1.2
phpMyEdit 5.7.1
mysql server 5.0.67-community
I have had phpMyEdit on my development server for some time now and someone copied some files from the production server, and now, none of the pages that use phpMyEdit are working.
I have check file permissions and that is not the problem.
I think it has something to do with mysql.sock, but I am not sure.
I removed the @ in the setupfile for $dbl = mysql_pconnect($hn, $un, $pw); and I got
"Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/phpMyEdit-5.7.1/phpMyEditSetup.php on line 165"
I can connect to mysql using php if I use "127.0.0.1", but not if I use "localhost".
I am not sure what is up with my loopback, because it looks ok in the hosts file.
Does anyone have a clue as to where I might look.
Thanks in advance,
Chris
|
ajh
Založený: 17.12.2003
Príspevky: 236
Zaslal: 2008-10-08 21:50
Návrat hore
Odpovedať s citátom
|
Can you ping localhost?
|
aceaid
Založený: 08.10.2008
Príspevky: 3
Zaslal: 2008-10-09 18:57
Návrat hore
Odpovedať s citátom
|
| ajh Napísal: |
| Can you ping localhost? |
Yes, no packets lost.
64 bytes from xxx.xxx.xxx (127.0.0.1): icmp_seq=16 ttl=64 time=0.036 ms
(x'ed out my real address since this is a dev machine)
|
ajh
Založený: 17.12.2003
Príspevky: 236
Zaslal: 2008-10-10 09:57
Návrat hore
Odpovedať s citátom
|
I might be completely off base here, but it looks as if PHP is connecting to MySQL via a socket rather than via the network. So my understanding is that when you use 127.0.0.1, it will use TCP, but when you use localhost it goes via the socket file "/var/lib/mysql/mysql.sock".
Have you checked the permissions on this socket file? It will need to be readable and writeable for the user or group that php runs as.
|
aceaid
Založený: 08.10.2008
Príspevky: 3
Zaslal: 2008-10-10 17:06
Návrat hore
Odpovedať s citátom
|
Well, it is fixed.
I'm not 100% sure why, but it definitely had something to do with permissions.
My solution was...
1. I stopped mysqld and apache
2. moved all the references to the socket in my.cnf and php.ini to /tmp
3. restarted mysql and apache
4. All was right with the world.
When I have a day free, I'll revisit this and see what more I can find on the subject.
I hope this posting helps someone in need.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|