Thanks for the reply.
Unfortunately, that's not the problem, because:
a) I'm compiling PHP as a CGI, and testing it directly on the command line.
b) I don't have any Servername 127.0.0.1 entry in my httpd.conf anyway.
So to summarise my problem, I have a PHP/mySQL compiled binary that I am testing on the command line (to simplify things).
It will connect to databases if I specify 127.0.0.1 as the servername parameter in mysql_connect(). It will spit the dummy if I call it "localhost".
The same scripts (using 'localhost') work fine under my production version of PHP (compiled many moons ago - I wish I could work out what I did differently).
When trying to connect to localhost, PHP returns this error:
<b>Warning</b>: MySQL Connection Failed: Can't connect to local MySQL server
in <b>test-mysql.php</b> on line <b>2</b><br>
where line 2 is the mysql_connect statement.
mysql_error() and mysql_errno() returns NULL.
Thanks anyway :-)
Scott.