Hello,
I'm trying to get apache2.2.6 to connect to a remote mysql5.1.22 DB using php5.1.6 but getting the following error when trying to connect:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'testDB' (13) in /var/www/html/test.php on line 3
Could not connect to the database. Error = Can't connect to MySQL server on 'testDB' (13).
If I run "php test.php" on the command-line it connects to the remote DB fine:
# php test.php
Congratulations!
<br>Successfully connected to MySQL database server.
<br>
<br>Now closing the connection...
<br>MySQL connection closed successfully as well.
I know php support is working on apache because I have a basic .php I use to verify that and is displaying php code fine. Here's a list of the php-related rpm's installed on the webserver:
# rpm -qa|grep -i php
php-common-5.1.6-3.7.fc6
php-mysql-5.1.6-3.7.fc6
php-pear-1.4.9-4
php-pdo-5.1.6-3.7.fc6
php-cli-5.1.6-3.7.fc6
php-5.1.6-3.7.fc6
php-ldap-5.1.6-3.7.fc6
php-gd-5.1.6-3.7.fc6
Here's a list of mysql-related rpm's on the webserver:
# rpm -qa|grep -i mysql
php-mysql-5.1.6-3.7.fc6
MySQL-python-1.2.1-1
mysql-5.0.27-1.fc6
mysqlclient10-3.23.58-9.2.1
perl-DBD-MySQL-3.0007-1.fc6
# rpm -qa|grep http
httpd-2.2.6-1.fc6
My php5 module is loaded:
# httpd -M (produces):
php5_module (shared)
My DB is compiled from source (didn't think that would make a difference), but here's the ver:
# mysql --version
mysql Ver 14.14 Distrib 5.1.22-rc, for redhat-linux-gnu (i686) using EditLine wrapper
Does anybody know of other ways I can troubleshoot this? I've tried cranking up the apache logs to debug, but still not seeing additional info.
Any help with this would MUCH appreciated.. I'm out of ideas
Thanks,
Jim