Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up a MySQL database, and all seems to be working except I cannot get PHP files to communicate with it. Just to be clear, the PHP files are correct, along with the host name, username, and password (I got the files from EasyAPNS). I have all of the ports open and phpMyAdmin does work, and PHP files run. I cannot get the database to work though. When the PHP files from EasyAPNS are run, I get return data stating that "We're having a slight problem with the database". Is there any common extra configuration that I might be forgetting about? Thanks.

share|improve this question
up vote 1 down vote accepted
  1. Does your script requires any php-mysql/php-mysqli modules and are they already installed.?
  2. Did you checked the database connectivity from localhost.? If not, check that first,

    mysql -h localhost -u dbusername -pPassword

Try to isolate the issue first, whether it is actually a communication problem with php & mysql or it is some problem with the database itself.

share|improve this answer
I says "The mcrypt extension is missing. Please check your PHP configuration." That's what it tells me, and I'll look for more modules that I might need. Thanks for your help! – Jack Humphries Aug 30 '11 at 0:35

Can you check this from shell...

$ cat > test.php
<? print_r(get_defined_functions()); ?>
$ php test.php | grep mysql_conn

If this does not result in something like

        [1182] => mysql_connect

You are likely missing a php-mysql module ; or it is not loaded.

php.ini or include of php.ini should have something like Is usually provided by extra package you can look up in your distributions package management system.

share|improve this answer
+1, I'll try that, thanks! – Jack Humphries Aug 30 '11 at 0:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.