mysql not connection through php - kinda urgent please

rastoma

Well-Known Member
Aug 27, 2001
158
0
316
when doing a simple mysql test on php, i get connection errors:

Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/xxxxx/public_html/test.php on line 9

Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/xxxx/public_html/test.php on line 9

Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/xxxxx/public_html/test.php on line 10

Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/xxxxx/public_html/test.php on line 10

Warning: MySQL: A link to the server could not be established in /home/xxxxx/public_html/test.php on line 10


I have tried the test file (simple php output plus test connection) and it works perfect. Not sure what's wrong here.

Got the php modules loaded:

LoadModule rewrite_module libexec/mod_rewrite.so
LoadModule bytes_log_module libexec/mod_log_bytes.so
LoadModule php4_module libexec/libphp4.so
LoadModule bwlimited_module libexec/mod_bwlimited.so
LoadModule dav_module libexec/libdav.so


I have ran latest buildapache.. same results.

Any suggestions?
 

bert

Well-Known Member
Aug 21, 2001
593
0
316
Same here. Trying to find out how to fix it. If you have fixed yours, I would certainly appreciate any help.

Thanks.
 

bert

Well-Known Member
Aug 21, 2001
593
0
316
Please I really need help on this. Does anyone have the old buildapache.sea that has the 4.1.2 version of PHP?? I have to go back to 4.1.2, this new version has too many bugs....

Thanks..
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
I am not sure if buildapache.sea changes the register_globals in php.ini to off. (It seems to be doing it by default in a new install.) It may be worth to have a look at your php.ini to see if it's turned on.
 

rastoma

Well-Known Member
Aug 27, 2001
158
0
316
[quote:89aa3b32ae][i:89aa3b32ae]Originally posted by bert[/i:89aa3b32ae]

Same here. Trying to find out how to fix it. If you have fixed yours, I would certainly appreciate any help.

Thanks.[/quote:89aa3b32ae]

That's been a month ago and MANY servers ago, but I believe I had to end up wiping the drive (since it was a new install)... I never got a reply here so it was quicker to fix my problem by just wiping and reinstalling.
 

gordita

Well-Known Member
Aug 14, 2001
113
0
316
solution

'/tmp/mysql.sock' is php's default location... but on most installs (including cpanel configs) the file is actualy in &/var/lib/mysql/mysql.sock&. So the solution is to change or create (you may have to create it if this is a new setup) your php.ini file with:
mysql.default_socket = &/var/lib/mysql/mysql.sock&;
 

HOSTFORWEB

Well-Known Member
PartnerNOC
Feb 6, 2002
94
0
306
Better solution

goto your /etc/hosts

127.0.0.1 localhost
serveriphere hostname shortname

Should look like this.

Restart apache, bind, mysql.

Everything will work fine.
 

bert

Well-Known Member
Aug 21, 2001
593
0
316
Thanks guys for all your help. I got it up and running :)
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
[quote:371d51b3e3][i:371d51b3e3]Originally posted by bert[/i:371d51b3e3]

Thanks guys for all your help. I got it up and running :) [/quote:371d51b3e3]
I am curious to know if you got it running again with 4.2.0 or did you have to revert back to 4.1.2? Have you found what the problem with 4.2.0 was?

Thanks.