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...

NoobEditor
  • 15,563
  • 19
  • 81
  • 112
Rob
  • 10,004
  • 5
  • 61
  • 91

2 Answers2

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.

Z Z
  • 78
  • 4
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

ingwy
  • 191
  • 1
  • 8