Hi all,
I'm trying to create a Drupal installation on a pair of clean Red Hat Enterprise 6 servers that I've built, one as an apache webserver and one as a mysql db server. Individually, both servers appear to be configured fine- I can talk to mysql through a client, and the webserver is serving pages correctly. However, when I load up the Drupal 7 installer and enter hostname/user/pass/dbname to connect to the db, it throws an error: Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'aetdbdev01.its' (13). My limited knowledge of mySQL informs me that this is a client-generated error code, implying that (despite what the message says) the server did not in fact respond at all to the request. In attempting to debug this issue, I've gone as far as to write a test script with a mysql_connect call and run it on the server, and when supplied the same creds as I'm giving to the installer it connects fine.
So, it seems like PDO is having some sort of issue. I had a look over the code, but I've never touched PDO before so really wouldn't know what to do. Any suggestions?
Thanks in advance for any help.
Comments
Same problem here
Same server os as well
subscribing
Problem solved!
After much googling (and figuring out that for some reason it all worked when php scripts were run from the command line but not when they were invoked by the webserver), I found this article: http://googolflex.com/?p=482. Turns out that on RHELS 6 the default selinux config is to enforce a fairly strict policy which includes segregating the webserver from, like, everything else.
The *nix team want me to figure out a more fine-grained approach that doesn't involve turning all security domains off before I productionise, but for now it's a dev environment so the easy fix is 'sudo setenforce 0'.
Having run that single command, it all works! :D