I have a Smarty-based site on propel.dreamhost.com and today I'm finding a blank page... turning on smarty debugging I get
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/.nittany/beezkneez/(mywebsite)/classes/db.class.php on line 40
I can connect to phpMyAdmin fine, and in my smarty config I have the correct values for host, username, password and database name (and I'm not using localhost for the MySQL hostname). I havent changed anything code-wise over Christmas.
I wonder if it's an environment thing though because line 2 of the error is:
"Could not connect to"
with no server name specified.
The Smarty line in db.class.php is
$sqllink = mysql_connect ($server, $username, $password) or die ("Could not connect to $server\n");
This is called from index.php:
$root = "";
$db = new DB();
$sqllink = $db->connect($sqlhost, $sqlusername, $sqlpassword);
I thought I would try setting the $root variable, to
.. no luck. Also, if I manually add the server/username/pass to the db.class.php connection code I then get the error:
Fatal error: Cannot instantiate non-existent class: db in /home/.nittany/beezkneez/(mywebsite)/index.php on line 29
I get this error even if I set the $host variable, so the include line
should work. And classes/db.class.php does exist.
Is this a problem with the server? Can anyone suggest other things to check?