Hi:
Here is the situation: the website and database work properly on the local computer. However, I am getting strange errors trying to use my website. When I attempt the login on the main page, I get these errors:
Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2) in /homepages/36/d288897568/htdocs/htdocs/member.php
A link to the server could not be established in /homepages/36/d288897568/htdocs/htdocs/member.php on line 9
Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2) in /homepages/36/d288897568/htdocs/htdocs/member.php on line 10
A link to the server could not be established in /homepages/36/d288897568/htdocs/htdocs/member.php on line 10
See how htdocs is listed twice? That does not look right. The database is perfectly accessible through the PHPMyAdmin portion of my Web Host.
I have the file structure set up so the index.php file is on the root folder, and the rest of the php files are in the htdocs folder. Here are the contents of the index.php file:
<?php
require_once('htdocs/ref_fns.php');
do_html_header('');
display_site_info();
display_login_form();
display_admin();
do_html_footer();
?>
Can you please help with this problem? Thank you in advance.
Dave
Newbie Help Please - Website will not work after upload
Moderator: General Moderators
-
cpetercarter
- Forum Contributor
- Posts: 474
- Joined: Sat Jul 25, 2009 2:00 am
Re: Newbie Help Please - Website will not work after upload
The root of you site is probably /homepages/36/d288897568/htdocs, and you have created another directory called htdocs below it. Having two directories called htdocs is a potential cause of confusion, but you can do it if you want. The files are clearly in the places you expect them to be in, otherwise you would get a fatal error in the first line of the script ('require' halts the script if it cannot find the named resource.)
If you can't connect to the database, the usual culprits are wrong username, wrong password or wrong hostname. Have you checked all these?
If you can't connect to the database, the usual culprits are wrong username, wrong password or wrong hostname. Have you checked all these?