Add PDO to installation requirements

catch - August 24, 2008 - 12:32
Project:Drupal
Version:7.x-dev
Component:install system
Category:bug report
Priority:critical
Assigned:Dave Reid
Status:needs work
Issue tags:installation, pdo, Usability
Description

We should add PDO as a system requirement to prevent fatal errors on hosts where it's not compiled into PHP

#1

redndahead - August 25, 2008 - 07:34
Status:active» needs review

Here is my patch. I don't know if there is a t() like function or an l() like function available during the DRUPAL_BOOTSTRAP_DATABASE phase. If there is, the patch will need to be updated to reflect this.

AttachmentSizeStatusTest resultOperations
pdo_requirement.patch1013 bytesIdleFailed: Invalid PHP syntax.View details | Re-test

#2

catch - August 25, 2008 - 08:46
Status:needs review» needs work

This needs to be in system.module's hook_requirements, there's no point checking on every page load. We'll also need to document it in the handbook.

#3

redndahead - August 25, 2008 - 15:28

I had it there first, unfortunately you will get a PDO error before you hit the hook_requirements. As soon as database.inc is included an error will popup. Unless I'm missing something, which is definitely possible since this is my first time working with the bootstrap process. This line is what first calls PDO in includes/database/database.inc:
abstract class DatabaseConnection extends PDO {

#4

catch - August 26, 2008 - 07:48

Hmm. Not sure how this works with the installer partial bootstrap, but assuming the same issue, we could maybe special case it in install.php/install.inc?

#5

Dave Reid - September 8, 2008 - 05:50
Assigned to:Anonymous» Dave Reid
Status:needs work» needs review

This requirement should be added to system_requirements() in modules/system.install, which is checked during the install process. I've confirmed my patch works properly during the install process and is ready for testing.

AttachmentSizeStatusTest resultOperations
299308.patch1.01 KBIdleFailed: 7199 passes, 4 fails, 0 exceptionsView details | Re-test

#6

Dave Reid - September 8, 2008 - 05:54
Status:needs review» needs work

Nevermind...looking into install_main in install.php...

#7

dgtlmoon - September 25, 2008 - 06:49

Maybe better to see if the PDO - if it does exist - is the PDO that does database stuff, someone could use code that happens to contain class PDO that aint the PDO you think it is

#8

Dave Reid - September 27, 2008 - 06:18
Status:needs work» needs review

New patch that checks to see if the 'PDO' class exists and if the 'PDO' class has the 'query' function right before needing database access. The language for the error screen is my first attempt, so feel free to modify and/or clarify. Sadly, not really much we can do to SimpleTest this, but I studied the install functions and this should be the right spot. Could use some help on some PHP 4 installs to see if this works.

AttachmentSizeStatusTest resultOperations
pdo_requirement-D7.patch1.49 KBIdleFailed: 7199 passes, 4 fails, 0 exceptionsView details | Re-test

#9

dropcube - September 27, 2008 - 13:41
Component:system.module» install system
Status:needs review» needs work

When an installation process starts, the first script requested is index.php, which starts a full bootstrap. During the bootstrap the file includes/database/database.inc is included, resulting in a fatal error in the definition of DatabaseConnection class: "Class 'PDO' not found" (when PDO is unavailable ofcourse). We shoud find other way to check if PDO is available before including the database.inc file.

#10

dropcube - September 27, 2008 - 13:42

When an installation process starts, the first script requested is index.php, which starts a full bootstrap. During the bootstrap the file includes/database/database.inc is included, resulting in a fatal error in the definition of DatabaseConnection class: "Class 'PDO' not found" (when PDO is unavailable ofcourse). We shoud find other way to check if PDO is available before including the database.inc file.

#11

earnie@drupal.org - September 27, 2008 - 14:09

subscribing

#12

earnie - September 27, 2008 - 14:10

subscribing

#13

Dave Reid - October 1, 2008 - 00:29
Status:needs work» needs review

Hmm... I really don't see any other options besides to make a some kind of check in the database.inc file itself. Attached patch checks in the DRUPAL_BOOTSTRAP_DATABASE in bootstrap.inc and transfers to a PDO error page in install.php

AttachmentSizeStatusTest resultOperations
pdo_requirement-2-D7.patch2.43 KBIdleFailed: 7241 passes, 4 fails, 0 exceptionsView details | Re-test

#14

dropcube - October 1, 2008 - 00:31
Status:needs review» needs work

We will require an approach like this #315513: Catch the absence of $databases settings array early. I can provide a patch now that #281446: Add 'status report' for installer requirements has been committed.

#15

Dave Reid - October 1, 2008 - 00:53

The problem is that the database.inc is included in drupal_maintenance_theme() within install_main(), which is called much, much before the call to install_check_requirements.

#16

dropcube - October 1, 2008 - 03:32
Status:needs work» needs review

@Dave Reid: We must avoid this kind of checking in every request since it burns CPU cycles on bootstrap. Checking before the installation process should be enough.

I have created a patch that actually works as expected. It checks the PDO availability in install_check_requirements, before the inclusion of the DB API files. The patch at #315513: Catch the absence of $databases settings array early is a subset of this one, which is required to detects during the DRUPAL_BOOTSTRAP_CONFIGURATION if there is a connection defined, and if not redirect to the installer before continuing to the next bootstrap phase.

These are screenshots of the Installer status report page, the first with PDO not-enabled and the second with PDO enabled.


Tests and feedback are welcome!

AttachmentSizeStatusTest resultOperations
pdo-requirement-299308-16-D7.patch6.19 KBIdleFailed: Failed to apply patch.View details | Re-test
pdo-not-enabled.png55.9 KBIgnoredNoneNone
pdo-enabled.png50.19 KBIgnoredNoneNone

#17

Dave Reid - October 1, 2008 - 04:51
Status:needs review» needs work

Trying the patch in #16, changed the following line in includes/database/database.inc to emulate not having PDO:

<?php
abstract class DatabaseConnection extends PDO_INVALID {
?>

Result on request to install.php:
Fatal error: Class 'DatabaseConnection' not found in /home/davereid/Projects/drupal-head/includes/database/mysql/database.inc on line 14

Result on request to index.php:
Fatal error: Class 'PDO_INVALID' not found in /home/davereid/Projects/drupal-head/includes/database/database.inc on line 137

Line 75 of install_main() in install.php require_once DRUPAL_ROOT . '/includes/database/database.inc'; runs before the call to install_check_requirements in line 125.

#18

redndahead - October 1, 2008 - 05:07

That would be expected as PDO_INVALID doesn't exist but PDO does. To emulate it you have to disable PDO in php.

#19

redndahead - October 1, 2008 - 05:07
Status:needs work» needs review

#20

Dave Reid - October 1, 2008 - 06:40
Status:needs review» needs work

If PDO is disabled, it would also be an invalid class, would it not? I'm just worried this is not actually being tested on a truly PDO-disabled PHP install.

So I took the time to actually disable PDO I get the same results as my emulation of renaming extends PDO:

Result on request to install.php (with patch from #16):
Fatal error: Class 'DatabaseConnection' not found in /home/davereid/Projects/drupal-head/includes/database/mysql/database.inc on line 14

Result on request to index.php (with patch from #16):
Fatal error: Class 'PDO' not found in /home/davereid/Projects/drupal-head/includes/database/database.inc on line 137

Please read my logic in #17 for why this patch does not work. There is a call to include 'database.inc' that happens before install_check_requirements in install_main().

#21

Dave Reid - October 1, 2008 - 05:49

Also, if I have PDO enabled, and the patch from #16 applied, I get the same Fatal error: Class 'DatabaseConnection' not found in /home/davereid/Projects/drupal-head/includes/database/mysql/database.inc on line 14 fatal error in install.php, so this is definitely code needs work.

#22

redndahead - October 1, 2008 - 06:08

It says in patch #16 that it requires the patch from #315513: Catch the absence of $databases settings array early Did you apply that also?

#23

Dave Reid - October 1, 2008 - 06:22

Patch in #16 contains the changes in the patch from #315513: Catch the absence of $databases settings array early and is the only one that needs to be applied.

#24

dropcube - October 1, 2008 - 14:25
Status:needs work» needs review

@Dave Reid: To test this patch, you should disable PDO extension in the PHP configuration. It is being tested on a truly PDO-disabled PHP install.

Line 75 of install_main() in install.php require_once DRUPAL_ROOT . '/includes/database/database.inc'; runs before the call to install_check_requirements in line 125.

Yes, but it is only included when

<?php
   $verify
= install_verify_settings();
?>
return TRUE, i.e., when a DB connection is already setup.

Attached an updated patch, fixing the problems reported in #20. Since I removed the inclusion of the database.inc file from theme.maintenance.inc, is required to include it in any other place, after the requirements checking.

Please test against HEAD.

AttachmentSizeStatusTest resultOperations
pdo-requirement-299308-24-D7.patch3.08 KBIdleFailed: Failed to apply patch.View details | Re-test

#25

Dave Reid - October 1, 2008 - 14:37
Status:needs review» needs work

@dropcube, It's perfectly valid for a user to have their DB information in their settings.php, but not have PDO enabled. That's why I was getting the error. I'm am actually testing this with actual PDO disabled instead of emulating missing PDO. Sorry I keep chiming in, but I truly want to help and get this fixed.

Using patch in #24, valid DB connection settings, but PDO is disabled. Request to index.php or install.php results in:
Fatal error: Class 'PDO' not found in /home/davereid/Projects/drupal-head/includes/database/database.inc on line 137

#26

Dave Reid - October 1, 2008 - 14:58

Another reason it would be perfectly valid to have a valid db connection setting already is if users are upgrading from D6 to D7. Overall, this new direction of checking for PDO in install_check_requirements does the same thing as was attempted in #2-5 (by checking for PDO in system_requirements in system.install) since install_check_requirements checks all the hook_requirements of the profile's modules, which all by default include the system module.

We need to make this a special case that runs very early in install_main(), change install_verify_settings() to return FALSE if PDO is not found, or make a special case install_check_d7_requirements() that runs very early in the install to check for fatal error-making requirements, such as PDO not found.

#27

dropcube - October 1, 2008 - 15:06

@Dave Reid: Could you please test with a clean Drupal installation. During an installation process, that started from 0, there is not a valid DB information in settings.php. You are right, when a valid DB configuration is already created, it fails.

To fix this, is required to make some changes in the installer workflow. Also, we can not check requirements in every request, they are just checked one time, before the installation process.

#28

catch - October 1, 2008 - 16:01

Since the database information changed in D7, people won't be able to simply drop their settings.php into their install - it'll have to be fixed as part of the upgrade process (still pending) - so if they're missing PDO or some other requirement they'll hopefully find out early on there.

#29

dropcube - October 1, 2008 - 16:11
Title:Add PDO to system requirements» Add PDO to installation requirements

Another reason it would be perfectly valid to have a valid db connection setting already is if users are upgrading from D6 to D7

Yes, the same will happen to PHP 5 -only functions/features, will fail with unrecoverable fatal errors. So I think we should rework the way the requirements are checked befor continuing with this.

#31

Dave Reid - October 1, 2008 - 19:00
Status:needs work» needs review

Here's another patch built off of #24.
- Moves the PDO check to system_requirements so that it can be checked by install.php and update.php
- If PDO is disabled, the install.php is allowed to get to the requirements page (and system_requirements).
- A graceful PDO error message is also displayed on update.php.

Tested on HEAD with and without PDO enabled.

AttachmentSizeStatusTest resultOperations
pdo_requirement-4-D7.patch7.93 KBIdleFailed: Failed to apply patch.View details | Re-test

#32

catch - October 1, 2008 - 18:36

@dropcube, I think install.php ought to handle fatal errors as quickly as possible - ideally moving the basic system checks before install profile installation. The scout seems like a contrib project to me.

#33

dropcube - October 1, 2008 - 18:52

@catch: Yes!, I just changed my mind about that. Too much to include and require to be an standalone script ;)

#34

dropcube - October 1, 2008 - 19:45

@Dave Reid: Even when this patch actually works and fixes the issue, I have been thinking and I would like a better approach:

The first step of the installation/upgrade process should be to run the requirements verification. For this, only bootstrap with the basis to display a maintenance theme, without including the DB layer nor any other layer that is not required.

Once the the server capabilities are checked, the user may continue with the other installer steps as it is now.

This will allow us to include as many basic requiremets as we need, without having to hard code checks before including files.

Here is an screenshot of what I mean:

Issue: #315901: Add server capabilities check to installation/upgrade tasks

AttachmentSizeStatusTest resultOperations
basic-requirements.jpg76.39 KBIgnoredNoneNone
basic-requirements.jpg76.39 KBIgnoredNoneNone

#35

Dave Reid - October 1, 2008 - 19:42

@dropcube, I think that would be a good step for the install process, although it's too bad that we'd have to have two different verify requirements-type tasks. The patch I have in #31 seems to work with just the one screen. I should test it on PHP4 though.

#36

dropcube - October 1, 2008 - 19:54

@Dave Reid: Have in mind that if there are not server/requirements problems those screens will be skiped.

My idea is to have an initial task, where only the very basic code is loaded. Also, I don't like to do things like if (class_exists('PDO') && !empty($databases)) { include the files }. what about if tomorrow we need to check if class Foo exists before including bar.php file.

The first task may be called "Verify server capabilities" and the other one "Verify profile requirements", or whatever you guys sugest ;)

#37

Dave Reid - October 1, 2008 - 20:02

@dropcube: You make a good point. I'm not sure how it could be accomplished since on PHP4 the install.php fails to run no matter what since there are try-catch statements that fail parsing.

#38

dropcube - October 1, 2008 - 20:14

An approach could be to move the install.php functions to other file, and to include that file if the basic requirements are meet, but not sure if this is the Drupal way. Please follow up in this issue: #315901: Add server capabilities check to installation/upgrade tasks

#39

Dave Reid - October 1, 2008 - 20:50

@dropcube: That's a good idea and direction for the server capabilities. I'm still going to continue effort here since this will become a potential issue during D6 to D7 upgrades with fatal PDO errors when running upgrade.php. Here's a revised patch that sticks to the issue at hand.

If and when #315901: Add server capabilities check to installation/upgrade tasks lands, this changes in this patch to the install.php file can be dropped, but the rest will still be important to prevent fatal errors when running update.php.

AttachmentSizeStatusTest resultOperations
pdo_requirement-5-D7.patch4.78 KBIdleFailed: 7199 passes, 4 fails, 0 exceptionsView details | Re-test

#40

Dave Reid - October 2, 2008 - 01:34

Actually, I'm just being stubborn. #315901: Add server capabilities check to installation/upgrade tasks would be useful on update.php as well for when Drupal is updated to another major version with different system requirements.

#41

Crell - October 6, 2008 - 05:02
Status:needs review» needs work

Why are we using class_exists() to check for PDO? That will trip the autoload functionality and depend on parsing order and so forth. Instead, http://us.php.net/extension_loaded is designed for exactly this purpose. :-)

#42

Dave Reid - October 6, 2008 - 20:18
Status:needs work» needs review

Good call Crell. Revised patch using extension_loaded.

AttachmentSizeStatusTest resultOperations
pdo-requirement-299308-D7.patch4.69 KBIdleFailed: Failed to install HEAD.View details | Re-test

#43

c960657 - October 28, 2008 - 20:03

The patch in #42 works fine with and without PDO enabled and with and without $databases setting in settings.php.

When linking to the PHP manual, I suggest using www.php.net rather than us.php.net or other national mirrors.

#44

Crell - October 29, 2008 - 05:26
Status:needs review» needs work

Code looks OK visually on quick inspection. I will take simpletest's word for it that it passes. #43 is correct about the link, though.

#45

redndahead - October 30, 2008 - 02:40
Status:needs work» needs review

Doc update in #43

FYI: I think the larger size is because my ide removed some spaces at the end of some lines.

AttachmentSizeStatusTest resultOperations
pdo-requirement-D7.patch5.03 KBIdleFailed: Failed to apply patch.View details | Re-test

#46

Anonymous (not verified) - November 13, 2008 - 07:03
Status:needs review» needs work

The last submitted patch failed testing.

#47

redndahead - November 13, 2008 - 17:52
Status:needs work» needs review

Rollin', rollin', rollin' keep them patches rollin' rawhide.

I would suggest the change in theme.maintenance.inc gets documented better. My guess is it's made so database.inc doesn't get called prematurely. But a comment on why it's not included with the rest of them would be helpful.

AttachmentSizeStatusTest resultOperations
pdo-requirement2.patch4.73 KBIdleFailed: Failed to apply patch.View details | Re-test

#48

System Message - November 16, 2008 - 22:05
Status:needs review» needs work

The last submitted patch failed testing.

#49

redndahead - November 17, 2008 - 07:49
Status:needs work» needs review

bot how you scared me so

#50

Arancaytar - November 17, 2008 - 10:25

Is there a good reason not to move all requirement checks to precede the database loading? This "server capabilities / requirements check" duplication seems likely to cause confusion.

#51

alexanderpas - November 18, 2008 - 02:11

#334086: Consistent error - declares PHP doesn't support database type has been marked as duplicate of this issue.

error message:

In your ./sites/default/settings.php file you have configured Drupal to use a mysql server, however your PHP installation currently does not support this database type.

Possible cause: PDO availble, mysql availble, PDO driver not availble.
Result: User Confusion.

#52

catch - November 18, 2008 - 10:04

Someone on #drupal had a similar issue to the one linked above - pdo and mysql installed, but not pdo_mysql. Most hosts only mention whether they have php or mysql (and maybe versions if you're lucky) - and a lot of users will only have ever needed to worry about that rather than specific extensions/drivers, so the more help we can give here the better. For a lot of people downloading Drupal 7, these errors will be the first they ever hear about the new requirements, and they're likely to be people on either commercial shared hosting, or on centrally managed servers in an organisation. We've also got the fact that this will affect people installing Drupal 7 on servers where Drupal 6 worked fine.

So if I've got it right, we need to first check if pdo is available, then check if there's a driver available. With either failure, seems like our best bet is to link to http://drupal.org/requirements - could probably start a Drupal 7 sub-page of that for now until we get to Beta ,so it doesn't get too cluttered (it's already a very complicated read).

#53

alexanderpas - November 18, 2008 - 10:24

can we have a drupal upgrade requirements checker module, so people can check if their server is capable before they upgrade.

Also +1 @dropcube

The first task may be called "Verify server capabilities" and the other one "Verify profile requirements"

as certain profiles may add additional requirements based on the modules that get loaded, also errors in the second part mean drupal can run but encountered simply fixable errors, while errors in the first part are usually unfixable without changing the server configuration.

#54

catch - November 18, 2008 - 10:37

alexandarpas - you mean for Drupal 5 / 6? - that sounds like a good idea, just needs someone to volunteer for it in contrib.

Note that this patch conflicts with #332303: bootstrap from sqlite - but we need to keep graceful error handling/information whatever happens with that.

#55

Crell - November 18, 2008 - 20:55

A D6 version of Upgrade status can/should include such checks for D7.

#56

catch - November 20, 2008 - 21:03
Status:needs review» needs work

Tested the patch by renaming /etc/apache2/conf.d/pdo.ini

It picks up the requirements check fine. A couple of things though - I agree with redndahead that this could use some more inline code comments. Also, the link should go to drupal.org/requirements - and we can link to php.net from there if needs be. For many people, enabling PDO will be 'send an e-mail to your hosting provider' or similar - so we need a nice friendly page for those people to visit when they completely fail to install Drupal on their random ass host.

#57

keith.smith - November 20, 2008 - 21:10

Also, "availablility" is a typo.

#58

ChrisBryant - March 13, 2009 - 18:08

This is still a problem on the current D7 head. On a test setup without PHP PDO enabled, Drupal just provides the following error:

Fatal error: Class 'PDO' not found in /home/kdeez/workspace/playground/drupal/includes/database/database.inc on line 184

Bumping as it doesn't seem there has been any activity on this recently and it's a critical usability issue.

#59

andreiashu - March 29, 2009 - 02:51

ChrisBryant is right. I found this issue because what is described in #58 happened to me too with the latest D7 tar.

#60

Bojhan - March 29, 2009 - 17:15

Sorry but is this patch adding another step to the installer?

#61

Dave Reid - March 29, 2009 - 17:40

No, it just makes sure that if PDO is not enabled, that it is caught on the 'requirements' task of the installer and that things don't fail spectacularly because PDO is not enabled (if you try it now, it's a potential massive upgrade #fail for users).

#62

redndahead - March 30, 2009 - 00:52

Re-roll with spelling correction and change of URL to requirements page. Is there a reason for install_verify_pdo() instead of just calling extension_loaded('pdo')?

AttachmentSizeStatusTest resultOperations
pdo-requirement-299308-3.patch4.8 KBIdlePassed: 10671 passes, 0 fails, 0 exceptionsView details | Re-test

#63

keith.smith - March 30, 2009 - 01:02

+    $requirements['pdo']['description'] = $t('Drupal requires the PDO library for database access. See the <a href="@system_requirements">drupal system requirements page</a> for more information on how to enable the PDO library.', array('@system_requirements' => 'http://drupal.org/requirements'));

"drupal" should be "Drupal". Or you could leave it out altogether as surely its clear what system requirements page is being referenced.

A larger issue is that I don't see on installation instructions on the requirements page except for a mention in a comment. It seems like, on a quick review, that the requirements page should list PDO as a requirement with a link to an existing or new handbook page that details installation.

#64

redndahead - March 30, 2009 - 01:09
Status:needs work» needs review

patch needs to be reviewed

#65

redndahead - March 30, 2009 - 01:12

removed drupal from name.

Requirements page needs and will be updated for D7. I'm just preparing ahead of time.

AttachmentSizeStatusTest resultOperations
pdo-requirement-299308-4.patch4.79 KBIdlePassed: 10671 passes, 0 fails, 0 exceptionsView details | Re-test

#66

Bojhan - March 30, 2009 - 12:48

The description is still far from good, assume one that doesn't know what PDO and API is. Try to start from scratch again, reworking this description without adding to much information.

Maybe we should not even try to explain PDO, and just forward people to on how to fix it.

#67

keith.smith - March 30, 2009 - 13:51

Maybe we should not even try to explain PDO, and just forward people to on how to fix it.

But isn't that exactly what this does?

#68

Bojhan - March 30, 2009 - 14:14

keith.smith: Yes it links, but what about the rest of the text? Remember that the audience of this text is the one with a "bad" host, so most likely won't know much about this stuff.

#69

redndahead - March 30, 2009 - 15:36

Bojhan - Can you give an example? I think this description does well to tell that there is an issue, what is the issue and where to go to fix the issue.

#70

catch - March 30, 2009 - 22:38

How about:

Your server does not have the PHP PDO extension enabled. [link to drupal.org]

The main thing is making sure people know it's a server issue (i.e. they can't just download something called PDO from somewhere to their Drupal directory to make it work). But the bulk of the work should be on the requirements page.

#71

redndahead - March 30, 2009 - 22:44

I like it.

AttachmentSizeStatusTest resultOperations
pdo-requirement-299308-5.patch4.77 KBIdlePassed: 10671 passes, 0 fails, 0 exceptionsView details | Re-test

#72

Dries - March 31, 2009 - 02:41
Status:needs review» needs work

Let's remove See the system requirements page for more information. from the sentence. I don't think we should link to a requirements page on d.o -- better to have the information in your Drupal site. Less indirections is better. Especially because the requirements page on d.o is not exactly user-friendly.

#73

redndahead - March 31, 2009 - 04:06

@Dries

It seems to me that linking to the requirements page would be best. As we come up with new ways this error can occur we can document it there instead of waiting for a commit. Especially after D7 is released.

Maybe we should make the requirements page more user-friendly.

#74

catch - March 31, 2009 - 12:29

If someone gets this error message, they're not going to be able to get past it without a significant change to their hosting environment - whether that's upgrading/recompiling PHP, modifying php.ini etc. - in most places where PDO isn't already enabled, this is going to require contacting their hosting provider, possibly changing hosting provider. In other words, there's a decent chance they won't be able to finish installing Drupal in one sitting.

We need to be able to take people through the process of understanding what PDO is, why the error might be showing up (is the extension just not enabled or is it completely missing?), and how to get it changed - which eventually could involve instructions for specific hosts (or at leat we can't only assume ssh access to the server). This is a lot of information to convey, and if we do a bad job of it, people are going to end up on google or giving up (and hopefully drupal.org/requirements eventually if we're lucky). Additionally the description for the error is absolutely not the place to put this information since there's going to be more than a couple of sentences.

There's various ways this could be done:

1. Commit the patch as is and make sure the requirements page is massively revamped as part of the d.o redesign (which it has to be anyway for people who get there before installing Drupal).

2. Ship with extra documentation on these major errors which can be viewed without a full Drupal bootstrap.

This could go two ways

a. Linking from the status report to .html files shipped with Drupal (similar to the new help system although wouldn't necessarily be connected unless we also wanted them available after install).

b. Class certain install requirement failures as COMPLETE INSTALL FAIL!11!! and make a new splash screen which looks completely different to the status report - "Sorry, your hosting environment is not configured to support Drupal, here's how to fix it".

c. link to INSTALL.txt and put the extra instructions in there.

d. some other relatively large reworking of this page.

However, these are significant changes to the installer, and are likely to need significant discussion before we can implement them - and they apply equally to incorrect MySQL, PHP versions etc.

fwiw, we already link to http://drupal.org/requirements in the following places in core:

catch@catch-laptop:~/www/7$ grep -r ".org/requirements" *
INSTALL.txt:(http://drupal.org/requirements) in the Drupal handbook.
modules/system/system.install:      $requirements['php_memory_limit']['description'] = $description . ' ' . $t('See the <a href="@url">Drupal requirements</a> for more information.', array('@url' => 'http://drupal.org/requirements'));
UPGRADE.txt:   http://drupal.org/requirements.

At the moment we either have a nasty PHP error as the first thing people see when they try to install Drupal, or an addition to the status report. However I think we need to seriously consider what to do in these situations since even if a small percentage of people run into this issue.

Personally I'd support committing the patch as is, then opening a critical/release blocker issue for the "what to say if someone isn't going to make it through the installer in one sitting". I also agree with redndahead that the /requirements page is more likely to stay up to date over the 2-3 years Drupal 7 will be in production.

#75

Bojhan - March 31, 2009 - 12:44

What about a specific handbook page on this? And then 1.

#76

earnie - March 31, 2009 - 13:44

IMO, the requirements need to be prominent at d.o. and a check box completed that the user understands the requirements before downloading the file. Alright, the check box idea is a bit much but the download page must give text that gives strong warning that the hosting provider must have these installed or installable for you. And if the user has an exception the user is redirected to the download page giving the requirements after and error stating that the environment doesn't meet the requirements.

#77

catch - March 31, 2009 - 14:38

There's a related discussion over at #315901: Add server capabilities check to installation/upgrade tasks - although the fixes in this patch probably be enough to un-postpone that issue now.

#78

varun21 - April 27, 2009 - 21:42
Category:bug report» support request

Pick the right option

If a user can't get past the PDO error message he will: -
a) Work with the hosting provider
b) Re-configure his hosting environment
c) Hack through the drupal files to get past the error message
d) Wait for Drupal to resolve the issue in a newer version for all the rocket-science in the CMS
e) Dump Drupal and move on with a random CMS that doesn't do "PDO" or whatever it means or matters :)

#79

Crell - April 28, 2009 - 15:11

He'll do the same as if he's on a host that doesn't support PHP 5.2. The only real options are A, B, and E. Proper error messages are there to encourage A and B rather than E. Some people will always do E, though, because they'd rather use their POS web host than Drupal. That's the price we pay for using technology that's less than ten years old.

How about helping come up with better error messages so that we can maximize A and B?

#80

anschinsan - October 29, 2009 - 14:05

I tried to install drupal 7 today for several hours. I spent them with debugging ... as I run in several errors in the following order:

XAMPP 1.7.0 on Windows ... Apache crashes because it's not working properly with PDO (As I found out later)

I changed to another server with Ubuntu/dapper and PHP 5.1.2 and got these errors: http://drupal.org/node/540034 because drupal 7 needs PHP 5.2 as minimum. (As I found out later, too)

After this I searched in the drupal forum for the requirements. I could not find a simple page for it but several entries for different versions of drupal, lots of questions and different answers. So I wrote a polite support request to which I wanted to upload the file with my error report. The upload failed and my elaborated text to ask for help was vanished. I thought 'This is a sign, not to ask stupid questions' ... and gave up asking.

I then tried to install the latest XAMPP Version 1.7.2 for Windows Vista ... but in this Versions seems to be a bug as I couldn't get php and mysql working together. (I really tried - but only for 20 minutes.)

I then decided to fix my XAMPP 1.7.0 as described here: http://www.apachefriends.org/f/viewtopic.php?f=16&t=32617 (hint: to download latest php version rewrite the path as link is broken)

Now XAMPP works and I get this error: Fatal error: Class 'MergeQuery' not found in D:\http\drupal7\html\includes\database\database.inc on line 721

Well, I'm rather discouraged now (or one could say depressed). It would be really nice to have a simple list for checking the proper requirements or - even better - to have a 'check requirements' page as first step of the installation process.

Whith this post I vote for it - and I hope to spare somebody hours of searching and trying, searching and trying, search ...

#81

Dave Reid - October 29, 2009 - 14:24

@anschinsan: You mean like http://drupal.org/requirements that's easily findable, linked from either the README or INSTALL.txt in your Drupal download and is the #1 Google result for "Drupal requirements"?

#82

Paul Kishimoto - November 4, 2009 - 21:17

Is this actually a support request now, or did varun21 make a mistake at #78?

#83

Dave Reid - November 4, 2009 - 21:46
Category:support request» bug report

Yeah that was a bad meta-data change as well as a bad attempt at sarcasm.

#84

epruett - November 11, 2009 - 23:35

This is going to put up some really bad roadblocks for your average Drupal users.
I thought one of the over-arching concepts behind Drupal 7 was to make it easier to use.
At this stage of the game it won't even install on servers that have been happily running Drupal 6.

 
 

Drupal is a registered trademark of Dries Buytaert.