Since #524728: Refactor install.php to allow Drupal to be installed from the command line was committed, I have not been able to install HEAD.

My problem is that, from a browser, realpath($_SERVER['SCRIPT_FILENAME']) is returning FALSE, so the installer does not run. IMHO, install.php needs to be another two-liner file with all the install functions moved to the includes dir fairly quickly.

Focusing on the more pressing issue, I have no idea why realpath() is returning FALSE and don't know enough about it to debug it at the moment. Any help would be appreciated!

Also, a quick workaround that I have been using is:

-if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) {
+if (realpath($_SERVER['SCRIPT_FILENAME']) != __FILE__) {

Comments

cweagans’s picture

Title: Cannot install HEAD due to #524728 » Improve CLI detection in install.php
Assigned: Unassigned » cweagans
Status: Active » Needs review
StatusFileSize
new720 bytes

From the code posted in #524728: Refactor install.php to allow Drupal to be installed from the command line, here's a patch to improve the CLI detection in install.php

Status: Needs review » Needs work

The last submitted patch failed testing.

webchick’s picture

Status: Needs work » Needs review

Sorry, my bad!

cweagans’s picture

Title: Improve CLI detection in install.php » Fix CLI detection in install.php

Renamed for accuracy

cweagans’s picture

StatusFileSize
new720 bytes

Fixed logic in patch.

catch’s picture

Status: Needs review » Reviewed & tested by the community

I have no idea what the original code was supposed to be checking, this actually makes sense. RTBC.

catch’s picture

Status: Reviewed & tested by the community » Needs work

doh, I was trying to work out whether PHP_SAPI constant might be better than the function, and in the process missed:

+if(php_sapi_name() != 'cli' || !empty($_SERVER['REMOTE_ADDR']))

needs a space after the if.

cweagans’s picture

Status: Needs work » Needs review
StatusFileSize
new747 bytes

New patch attached. Also un-deleted the comment right above install_drupal()

cweagans’s picture

StatusFileSize
new721 bytes

Real patch attached.

catch’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Quick fix

Much better.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

Automatically closed -- issue fixed for 2 weeks with no activity.