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.
Comment | File | Size | Author |
---|---|---|---|
#3 | install.requirements.patch.txt | 961 bytes | Robrecht Jacques |
Comments
Comment #1
chx CreditAttribution: chx commented4.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).Comment #2
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedYou 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?
Comment #3
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedAnd 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.
Comment #4
Steven CreditAttribution: Steven commentedThe 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.
Comment #5
(not verified) CreditAttribution: commented