Hey Guys,

I have a multisite install of drupal all working fine. I am making the change to php-fpm and nginx from apache and mod_php and I am noticing that I am getting

Site off-line The site is currently not available due to technical problems. Please try again later. Thank you for your understanding. ________________________________________________________________________________________________________________________________________________________ If you are the maintainer of this site, please check your database settings in the settings.php file and ensure that your hosting provider's database server is running. For more help, see the handbook, or contact your hosting provider.

Now I know that the database file is working correctly and the server is pointing to the correct place because everything works under Apache. So I am a little stuck as to why i am getting this message.

Is there a log file?
Could it be a php setting?
What is the main reason for getting this error?

Thanks in advance.

Comments

scrypter’s picture

I don't know about nginx or php-fpm but I have had this if the $db_url is incorrect in sites/default/settings.php as the message explains. If you have shifted your site then the new db may have a different name or user/pw.

I guess your new server will have log files. If you have command line access you should be able to read them.

In my experience, Drupal is extremely easy to shift. Copy all the files, copy the db, then there is usually only ONE thing to change and that is the settings.php file. Sometimes there maybe permissions to be tweaked on the file upload folders.

www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy

stewart.matheson’s picture

Scrypter,

Thanks for your reply. I have not chagned the database. Its the exact same DB that apache is using. I also have not chagned the settigns file as both nginx and apache point to the same folder. Any other suggestions?

scrypter’s picture

The way I would approach this now, is to work back from that message which comes from line 180 in /includes/database.inc, and see what it is causing it. You could remove the && ini_get('display_errors') from the if statement so that more detail of the error might be shown.

Use a line of code like:- var_dump(debug_backtrace());die; inside _db_error_page() to see which function called it. Just keep truckin until you get to the cause. It seems nginx is not finding the db, but why?

You could write a small test.php file containing

phpinfo();

Put this in the drupal root folder and run it. It should give details of the database connectors you have set up inside php. It could be that there is none. If you google for "nginx config mysql" (no quotes and whatever db you are using) you will see a few posts about this. It seems setting up nginx is not simple.

Please post the answer when you find it for others (and I am curious!).

www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy

yub_yub’s picture

This was a helpful response, thanks very much. Removing && ini_get('display_errors') from line 180 of database.inc allowed me to see the error. I have a similar issue but I think I am just a ticket away from having my hosting company fix it.