1

I have implemented a phpGrid that works in my dev environment but just keeps saying:

Error: Could not connect to the database

in production

I am logging failed attempts at MySQL connections in the logs on and if I put in a dodgy username and password in the conf.php files username/password it does not show up in the log (I've tested the log is working by attempting to connect with bad credentials via a terminal.

The host is just "localhost" I am using PDO connections elsewhere within my code and the are all connecting using "localhost" so I see now reason why this would be a problem.

In the conf.php I've turned on:

define('DEBUG', true);

And on my grid I have:

$dg -> enable_debug(true);

But I just keep getting this stupid error that tells me nothing about what's really going on...

2 Answers 2

3

It happened to me as well. Finally I was able to figure out. The reason is mySQLi was not enabled on the server. I enabled it and it works now.

Sign up to request clarification or add additional context in comments.

Comments

1

Sorry, i cannot add a commant and sorry for my english.

If you are using PHP 5.5 try:

error_reporting=E_ALL^E_DEPRECATED

at top of the page for the time being.

For the files on your production machine: proof if they are still in utf-8 encoding

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.