Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
No MySQLi Connection Error on Ubuntu 12.04 LTS (elementary OS)
  • Hi Guys, I just want a little help here. I setup apache2 on my ubuntu machine for testing and I get this error. I changed the parameters db.php in the development folder of the config and all but I still get this error. I have phpmyadmin setup and it is working. I also have mysqli php module installed since it is needed for myadmin to work.

    I am a bit new to working my projects in an ubuntu environment. But since the db is working and php sees it via phpmyadmin, I am thinking it something in fuel. But the error message is not helping me determine the cause. Is there a way for me to determine what could be the cause?

    here is the copy of the host file: http://pastebin.com/nrpjBqHv
    here is the copy of the db.php in dev config folder: http://pastebin.com/BSk0KdGW

    Update: I forgot to add, I am using MariaDB 10.0.8. But on Windows and CentOS (VPS), it works just fine.

    Update2: the application folder, I set the chmod to 777 since it needs to write in the log file and be able to use my IDE to edit the files. the chown is also changed to www-data:www-data as per default apache2 user/group.
  • You get the error in the application, or in an oil script on the commandline?
  • Application.
  • MariaDB here too, so that is not an issue.

    You are sure your app runs in 'dev' mode (i.e. are you looking at the correct config file)? Not secretly a SetEnv somewhere? Can you add a die() to that db.php, to check if it's being loaded at all?
  • Yes. I try die() on the db.php file and it worked. I also did changed the the type from mysqli to mysql it gave a blank "Fuel\Core\Database_Exception [ Error ]:".
  • Very weird. No error message at all?

    Never seen that, and no explaination for it...
  • you could try to print mysqli error :
    in fuel/core/classes/database/mysqli/connection.php, add this line 137 :
    die(mysqli_connect_error());
  • I changed the connection.php and it returned me a "Fuel\Core\Database_Exception [ Error ]:" error.
  • Again without error message?

    What you can do is go into ./fuel/core/bootstrap.php, and comment out the set_exception_handler() and set_error_handler() definitions.

    This will cause Fuel not to capture any error message, so you can see the plain PHP error. Perhaps that gives a clue?
  • Harro is write, sometimes a plain php error tells a lot.
    You can try also to put die(mysqli_connect_error()); in connect.php on line 129, juste before throw new \Database_Exception($this->_connection->error, $this->_connection->errno);

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion