/
Verify proper MySQLi configuration during installation [5.3.0-B1]

Verify proper MySQLi configuration during installation [5.3.0-B1]

Recently we had one server, where In-Portal wasn't working due misconfigured PHP and notices from debugger haven't given much clue to the end user on how the issue can be resolved.

This isn't much of the issue for In-Portal 5.2.1, where MySQL PHP extension is used, but in In-Portal 5.3.0 the MySQLi PHP extension is used and if the PHP is misconfigured then we have no access to the database.

I propose, that at step when we validate database connection credential (in the kDBConnection class) we check if we're getting following error back:

Warning: mysqli::mysqli(): (HY000/2002): No such file or directory

then we should:

  1. read the "mysqli.default_socket" setting from "php.ini" (if it's empty, then assume it's value as "/tmp/mysql.sock")
  2. check if socket file mentioned there exists on disk
  3. if file is not there (which should be true at 100% times) then show nice error back to user saying:
Please verify that MySQL server is running and path to it's socket file is specified in "mysqli.default_socket" setting in the "php.ini" file.

In fact when we stumble upon this error then throw an exception right away.

Related Tasks