The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mysql not connection through php - kinda urgent please

Discussion in 'General Discussion' started by rastoma, Apr 4, 2002.

  1. rastoma

    rastoma Well-Known Member

    Joined:
    Aug 27, 2001
    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    16
    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?
     
  2. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Same here. Trying to find out how to fix it. If you have fixed yours, I would certainly appreciate any help.

    Thanks.
     
  3. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    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..
     
  4. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  5. rastoma

    rastoma Well-Known Member

    Joined:
    Aug 27, 2001
    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    16
    [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.
     
  6. gordita

    gordita Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    113
    Likes Received:
    0
    Trophy Points:
    16
    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&;
     
  7. HOSTFORWEB

    HOSTFORWEB Well-Known Member
    PartnerNOC

    Joined:
    Feb 6, 2002
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  8. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Thanks guys for all your help. I got it up and running :)
     
  9. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    [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.
     
Loading...

Share This Page