Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Installed D7 without a pre-made settings.php for the first time in months today, this is what it looks like:
Adding 'alpha blocker' tag since this is likely to stop people before they even get started.
Comment | File | Size | Author |
---|---|---|---|
#12 | drupal_621366.patch | 934 bytes | Steve Dondley |
#11 | drupal_621366-2.patch | 931 bytes | Steve Dondley |
#2 | drupal_671366.patch | 672 bytes | tobiasb |
Configure site | Drupal_1262237212305.png | 79.41 KB | catch |
Comments
Comment #1
Garrett Albright CreditAttribution: Garrett Albright commentedHere's a text dump of all those warnings (paths different, obviously):
Warning: PDO::__construct(): [2002] Invalid argument (trying to connect via unix://) in /Users/garrett/Drupal/drupal/drupal/includes/database/database.inc on line 332 Call Stack: 0.0065 1318144 1. {main}() /Users/garrett/Drupal/drupal/drupal/install.php:0 0.0099 1730064 2. install_drupal() /Users/garrett/Drupal/drupal/drupal/install.php:1755 0.1011 13114920 3. install_run_tasks() /Users/garrett/Drupal/drupal/drupal/install.php:87 0.2792 14136848 4. install_run_task() /Users/garrett/Drupal/drupal/drupal/install.php:347 0.2865 15061728 5. drupal_build_form() /Users/garrett/Drupal/drupal/drupal/install.php:397 0.2917 15764520 6. drupal_process_form() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:224 0.2946 15883056 7. drupal_validate_form() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:611 0.2946 15883968 8. _form_validate() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:789 0.2954 15943872 9. form_execute_handlers() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:934 0.2955 15948192 10. install_settings_form_validate() /Users/garrett/Drupal/drupal/drupal/includes/form.inc:990 0.2955 15950264 11. install_database_errors() /Users/garrett/Drupal/drupal/drupal/install.php:938 0.2962 15952552 12. db_run_tasks() /Users/garrett/Drupal/drupal/drupal/install.php:974 0.2962 15953488 13. DatabaseTasks->runTasks() /Users/garrett/Drupal/drupal/drupal/includes/install.inc:1106 0.2962 15953488 14. DatabaseTasks->connect() /Users/garrett/Drupal/drupal/drupal/includes/install.inc:336 0.2962 15953488 15. Database::getConnection() /Users/garrett/Drupal/drupal/drupal/includes/install.inc:373 0.2963 15953624 16. Database::openConnection() /Users/garrett/Drupal/drupal/drupal/includes/database/database.inc:1392 0.2963 15957672 17. DatabaseConnection_mysql->__construct() /Users/garrett/Drupal/drupal/drupal/includes/database/database.inc:1537 0.2963 15961072 18. DatabaseConnection->__construct() /Users/garrett/Drupal/drupal/drupal/includes/database/mysql/database.inc:36 0.2963 15962024 19. PDO->__construct() /Users/garrett/Drupal/drupal/drupal/includes/database/database.inc:332
You'll see similar warnings at other steps in installation.
Comment #2
tobiasbComment #3
tobiasbComment #4
David_Rothstein CreditAttribution: David_Rothstein commentedThe patch works, but rather than converting it to an array always, I think it might be better to use some kind of !empty() check before looping through the databases?
@catch, I can reproduce this bug, but only on the "Verify requirements" screen... how did you get past the requirements verification to make this screenshot? (If you don't have a settings file at all, you shouldn't be able to get past that stage, right?)
@Garrett Albright: Looks to me like the warnings you're seeing are a different issue.
Comment #5
catch@David - my install was already there, so I didn't have to get past 'verify requirements' since file directory, settings.php etc. permissions were filled in. Also I get a full screen of warnings, but can still fill out and submit the form etc.
Comment #6
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commented#2 works like a charm.
Comment #7
webchickOuch. :\
To clarify: you'll get this problem if the installer attempts to trigger an error message in the step prior to asking for database info because settings.php isn't there.
I confirmed the patch works but agreed with David that it feels very much like "treating the symptom". For instance, why are we even attempting to parseConnectionInfo() if we don't have a settings.php file?
Comment #8
webchickComment #9
Steve Dondley CreditAttribution: Steve Dondley commentedI just found the problem and created a similar patch. I think it's a little more logical to put it in the _db_check_install_needed function. See http://drupal.org/node/672940#comment-2429284 for my patch. Though, yeah, ideally, the function to parse the file should not be called at all.
Comment #10
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commented#672820: Bad foreach() argument in database.inc looks like a duplicate of this.
Comment #11
Steve Dondley CreditAttribution: Steve Dondley commentedOK, here's a patch with a different approach. It also gets rid of what appears to be an unnecessary line now. I ran through the install and it got rid of the errors.
Comment #12
Steve Dondley CreditAttribution: Steve Dondley commentedThinking about this a bit, I think it should explicitly check to see if $databases is an array. Not sure, though.
Comment #13
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis is basically a duplicate of #315513: Catch the absence of $databases settings array early, which is needed anyway.
Comment #14
atheneus CreditAttribution: atheneus commentedPatch #12 works and fixes the issue. However, I would tend to agree with webchick #7 that there should probably be a check for the settings file before trying to read information from it.
In fact - it seems really clumsy to me that we are setting new users up for failure on the first install by having an error be almost certain to be their first experience of installing Drupal. Shouldn't we be helping them to create the settings file from the installer? Basically, most people have to jump to their file browser / terminal and copy the default.settings.php file to settings.php and proceed. Why can't we automate the creation of the settings.php file since it gets updated with database information during the install process anyway?
I'd rather we could make the install process as fail-safe as possible.
Comment #15
atheneus CreditAttribution: atheneus commented@david (#4) - If you click on continue without creating the settings.php file, ignoring the warning you will go to the database setup page shown in the screenshot. I think this should be considered a separate bug. If I receive a warning but can continue regardless I can only assume the warning is not that serious. Again, I think there needs to be more work done on the installer to make it as fail-safe as possible. Let's adopt the Kaizen principle of Poka-Yoke (fool proofing) here.
Comment #16
Steve Dondley CreditAttribution: Steve Dondley commentedThe issue referenced in #13 is also related to #299308: Installing Drupal by visiting index.php (rather than install.php) leads to a fatal error when PDO is not enabled
Comment #17
Garrett Albright CreditAttribution: Garrett Albright commentedI guess that the reasoning is that we want the user to have to take some sort of certain manual action on the server before installation can succeed (besides just installing/uploading the Drupal directory, anyway) in order to ensure the person doing the installation is indeed the administrator of the site instead of just some slob who managed to find the directory and can now wreak havoc with it. I agree, though, that having the requirement to do this initially presented to the user (making the safe assumption that they're ignoring any sort of documentation - does anyone still read the instruction manuals that come with video games?) be in the form of an error is unpleasant.
Comment #18
atheneus CreditAttribution: atheneus commentedMy concerns on the ease of installation is really a user experience issue so I will followup in the appropriate forum:
http://www.d7ux.org/installation/#comments
Comment #19
webchickThere's an issue at #418302: Copy default.settings.php to settings.php during install IFF webserver owns files (FTP on shared hosting) to solve the issue you're talking of atheneus... but it's doubtful that'll make it into 7.x at this point unless someone dives in on that right now.
Comment #20
webchickRemoving tag, since this is a dupe now. If all else fails, I can come back and commit that cast patch, but I'd rather solve the underlying issues. See you folks in them. :)