0
votes

I have a cake installation on a webserver and a database on a separate server.

I am able to connect to the database remotely via shell, but my cake gives

Error: Mysql requires a database connection

Error: Confirm you have created the file : app/Config/database.php.

Notice: If you want to customize this error message, create app/View/Errors/missing_connection.ctp.

I checked and PDO is setup, mod_rewrite is enabled and I have a similar setup on development server running properly. I checked core.php and it echoes proper base site url, and database.php echoes proper database selection.

Any ideas what may be causing it?

1

1 Answers

0
votes

Trying to cover all of the possibilities...

With regard to the database.php file, make sure that the database credentials are being set to the $default variable and not $test, unless of course you're trying to run database unit tests of course.

The file that handles all of the initializing is the webroot's index.php file. You'll want to verify that all paths within that file are using the proper paths. If all you did was extract the CakePHP framework without any folder rearrangements, it should be all correct.

You mention that you checked mod_rewrite is enabled - did you do this with a phpinfo() call to a file located on the same (sub)domain just to verify the settings in the same location?

Although not related to the errors you're experiencing, you'll also want to verify that the external DB allows connection from your webserver's IP.