Results 1 to 4 of 4

Thread: Fatal error on website built in PHP/MySQL

  1. #1
    Join Date
    Jun 2009
    Posts
    83

    Fatal error on website built in PHP/MySQL

    One of my friends had problems with his former host and ask me if I could help with his site PHP/MYSQL. I give it everything he could retrieve the ftp root but could not retrieve the database

    So I start by copying everything, but I get this error message

    Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2) in /homepages/27/d285131543/htdocs/THESITE/www/Connections/dbconnect.php on line 9

    Fatal error: Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2) in /homepages/27/d285131543/htdocs/THESITE/www/Connections/dbconnect.php on line 9

    So I create an empty mysql database and change the dbconnect.php

    But what I get this error message

    Fatal error: Cannot redeclare __autoload() (previously declared in /homepages/27/d285131543/htdocs/THESITE/www/includes/tng/tNG.inc.php:87) in /homepages/27/d285131543/htdocs/THESITE/www/includes/tng/tNG.inc.php on line 303

    Can someone please help me? Is this problem of PHP or MySQL?

  2. #2
    Join Date
    Nov 2008
    Posts
    1,192

    Re: Fatal error on website built in PHP/MySQL

    '/tmp/mysqld.sock' -> I think that is the directory /tmp that does not exist or you do not have the correct rights

    Cannot redeclare __autoload() -> method has been reported 2 times, you must remove it from one place.

  3. #3
    Join Date
    Nov 2005
    Posts
    1,323

    Re: Fatal error on website built in PHP/MySQL

    • Backup the database - which had to be done regularly
    • Documentation Program


    Otherwise, if a CMS, you should be able to leave this in installing and export/import of database.

    And if the "home" program is undocumented, without backup. Good for him!

    Ultimately, if the BDD has been built correctly, it will peel all the code to get information on the database (tables => fields, logical links between tables, etc..) And try to rebuild the database from there ...

    But in this case, it might be altogether easier to redo the program, by documenting and including regular automated backups.

  4. #4
    Join Date
    May 2008
    Posts
    685

    Re: Fatal error on website built in PHP/MySQL

    Well for the first message "Can not connect to local MySQL server ..." it's just that you have provided wrong logins to the database, check it once again.

    For the second problem, go to line 303 in your file /includes/tng/tNG.inc.php and put it around your function __autoload:

    if(!function_exists(__autoload)) {

    }
    It should at least avoid you having fatal error and allow you to move a little

Similar Threads

  1. Replies: 5
    Last Post: 19-03-2012, 09:48 AM
  2. Replies: 5
    Last Post: 08-03-2012, 09:44 AM
  3. Replies: 3
    Last Post: 07-11-2009, 09:36 PM
  4. How to Connect to MySQL database on my website?
    By Zombi in forum Software Development
    Replies: 3
    Last Post: 24-09-2009, 01:23 PM
  5. Replies: 4
    Last Post: 25-05-2009, 11:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,471,653.18090 seconds with 17 queries