Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-8714 now.

Incorrectly checks for database file existence (new)

The phpBB install process, throughout the 3.0.x line, has an issue with validating the existence of an SQLite database file given to it. This bug is really easy to replicate, here's some step-by-step instructions.

1. Begin the install process as usual.
2. When you reach "Database information", select "SQLite" as the database connection method, then enter a non-existent filename in the "Database location/DSN" field. Attempt to proceed.
3. The install script will report a "Successful connection". Proceed as usual.
4. When you reach the point where the databases are written, many errors arise from attempting to write to the non-existent file.

For your convenience, I've supplied a fixed version of the offending file (functions_install.php) which you could integrate into the next version or whatever, if you want.

Comments / History

Linked ticket with changeset: r10165

Action performed by nickvergessen (Development Team Member) on Sep 19th 2009, 12:21

Unlinked changeset: r10165

Action performed by nickvergessen (Development Team Member) on Sep 21st 2009, 11:22

Posted by TerminILL on Sep 22nd 2009, 06:24

Stupid attachment thingy. Anyways, here's some really basic code that would work - just a file_exists() check before it tries to connect. Have an example.

Code: Select all
   // Check for SQLite DB actually existing (because it doesn't do that for some absurd reason)
   if (($dbms_details['DRIVER'] == 'sqlite') && !file_exists($dbhost))
   {
      $error[] = 'Hey... this needs an error message.';
      return false;
   }

Posted by TerminILL on Oct 1st 2009, 07:11

Just checked out 3.0.6 RC2, seems to have been rectified. Or it was a strange windows-only PHP/SQLite bug (my windows machine was being stodgy, so only tested on linux)

Ticket details