Comments are available to members only. Sign up or Log in to view these comments.
Main Topics
Browse All TopicsI am trying to connect to a remote myql database server which is running centos 4.4 with mysql 5.0.27.
The website server is using apache (httpd 2.2.3), PHP 5.1.6 and Mysql Client API version 5.0.22.
Using a basic php script that does notthing but use mysql_connect to connect to the database server I get the following behaviour.
When run by accessing the php file through apache I get the error
"2003 : Can't connect to MySQL server on 'xx.xx.xx.xx' (13)"
where 2003 is the mysql_errno and the rest is mysql_error (I replaced my actal db server ip with xx for obvious reasons).
But If I run the same file from the command line "php connect.php" it connects to the db server no problem. As well if I run "mysql -h xx.xx.xx.xx -u ASDF -p" I can connect no problem as well. And just to be sure I have turned off iptables while trying to debug this problem.
I have setup a mysql db on the webserver and had no problem connecting to localhost... It is only a problem when trying to access a remote db server.
I have run the same php file from other servers and they have no problems connecting when run through apache (they have different centos versions but all 4 and above).
I have looked everywhere I can think to try and find some firewall like setting that is only active when running php/mysql through httpd but have come up empty. I hope there is just some simple httpd.conf setting that I have overlooked but at this point I am desperate to find it...
Thanks for reading.
Jamie
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: richswyattPosted on 2007-06-01 at 05:14:41ID: 19194440
Comments are available to members only. Sign up or Log in to view these comments.