hmmm.... siteguard is not a valid PHP configure directive. It must be a custom extension. Maybe PEAR or other PHP project has added that to the library. Or even the ISP might have added that in their as their own PHP extension.
I do not know what it does and there is no documentation at php.net, so I will not specualte other than the name does make it sound like it could be thr culprit here.
But like I said, if you have shell access, you'd be best to try to connect manually from the aflicted server as the MySQL moniter would be helpfull in troubleshooting.
And I do think the fact that your mysql_connect fails to report a timeout within the 30sec script time is very odd.
Once again, leading back to that unknown Directive in your config.
perhaps you could try this little trick and see if it gets you anywhere:
<? ini_set('siteguard', false); ?>
...just put that at the top of your script.
I don't know if that will work, but it's worth a shot.
Also look for sitegourd references elsewhere in your phpinfo, see if it has parameters that you can latch onto with ini_set and ini_get and see if you can disable it.
This snippit will print out all user functions for module site gaurd (if it is indeed a module)
<? print_r (get_extension_funcs ('siteguard')); ?>
By detecting user functions, you might find a way to disable it with it's own features.
But, there are too many if's here, so be prepared for some head banging and hair tearing 😃