During the installation process (install.php), the database is setup first. In my case this failed mysteriously (no mysql_error message at all) because I had an old version of PHP installed (mysql_connect only has 3 parameters).
After some investigation, I noticed that the php version is checked in system.install, but would it not be a good idea to move this to the install process (install.php or includes/install.inc)? Just like install.php checks whether sites/default/settings.php is writable before doing anything else.
This way, the dependencies of Drupal on php version, apache version, etc is checked *first*.

And yes, I know, the INSTALL.txt tells me the required php version and I will do a RTFM next time.

CommentFileSizeAuthor
#3 install.requirements.patch.txt961 bytesRobrecht Jacques
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

4.3.0 Added the client_flags parameter. you do not have an old php version, you have an ancient one (27-Dec-2002 : The PHP developers are pleased to announce the immediate availability of PHP 4.3.0).

Robrecht Jacques’s picture

Priority: Normal » Minor

You must have missed the point.

Why do you check the ancientry of the PHP in system.install (it checks for > 4.3.3) when someone with a version < 4.3 doesn't even arrive at that point because he can't get pass the "database configuration" page of install.php where the system doesn't give him any idea as of why (apparently no mysql_error())?

Why not check PHP version first?

Robrecht Jacques’s picture

Status: Active » Needs review
FileSize
961 bytes

And this is a patch.

Think of it: I spent quite some time figuring out why Drupal would not install. The page I got only mentionned things about the database (password and username correct?, database server running?, ...), while the error had nothing to do with the database, but with the wrong php version. If you give an error message, make sure it is the right one.

Steven’s picture

Status: Needs review » Fixed

The database connection in the form validation is the only one which must succeed, so moving the requirements checking earlier should allow more broken installations to at least report the version error correctly.

However, there is still plenty of code run before the version check, even after this patch. This is how the installer was designed... the only bulletproof way around it would be a very user-unfriendly print-and-die at the very beginning of install.php. So, there is no guarantee that users won't still run into vague errors if they are running a really old version of PHP.

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)