After last CSS preprocessing patch my install.php shows fatal error:
Call to undefined function file_directory_path() in @$#%\includes\common.inc on line 1429

Comments

ChrisKennedy’s picture

That happens to me if I go to install.php when drupal has already been installed. Is this what you're doing?

ChrisKennedy’s picture

Priority: Critical » Normal

Downgrading to normal for the time being.

tema’s picture

Priority: Normal » Critical

I'm trying to run multisite installation on my local system (XP, XAMPP). Sites are subdirs which are aliases of the same Drupal directory. Each site have own settings.php in separate dir (/sites/[host].[alias]) with different MySQL bases pointed there. Two of them are installed and running ok, when I'm trying to install the next one it throws that error.

Thanks for assistance!

ChrisKennedy’s picture

Priority: Critical » Normal

Please verify that the next site is using its own settings.php and not the settings.php from the other two sites. For example, temporarily rename the settings.php from the installed sites to _settings.php.

tema’s picture

Priority: Normal » Critical

One more thing:
my root .htaccess file is modified as described here and 'clean_url' setting are forced on in each settings.php (it works and I can't find another way to do this):

$conf = array(
  'clean_url' => 1,
);
tema’s picture

Priority: Critical » Normal

Sorry: priority back to normal.
Yes, the problem is in settings.php location. Thanks, now digging...

tema’s picture

Status: Active » Closed (fixed)

Sorry, I was wrong, everything works ok!

phicarre’s picture

Version: 5.x-dev » 5.0-rc1

same problem for me
i upgrade from 5.0 beta 2 to 5.0-rc1

smmilton’s picture

Status: Closed (fixed) » Active

On new installation of 5.0-rc1 the database selection screen pops up, and then saves the settings, and in the background with no displayed info, sets up the database tables. When it redirects to the index.php, it goes blank. Further running of install.php comes up blank. Errors in the apache logs look like:

[client xx.xx.xx.xx] PHP Fatal error: Call to undefined function: file_directory_path() in /var/www/drupal/includes/common.inc on line 1429, referer: http://host.sample.com/install.php?profile=default
[client xx.xx.xx.xx] PHP Fatal error: Call to undefined function: user_access() in /var/www/drupal/modules/block/block.module on line 68

I deleted the install dir, dropped the tables, and rolled back to beta2, and all works well.

System environment:
Centos 4.4 system running in Virtuzzo VPS.
php 4.3.9
apache 2.0.52
mysql 4.1.20

ChrisKennedy’s picture

Please see if the latest patch at http://drupal.org/node/100476 fixes the problem.

RobRoy’s picture

Version: 5.0-rc1 » 5.x-dev

I can successfully reproduce this error when I try to install Drupal on an existing database using the same prefix as an existing installation. In other words, if Drupal tries to create a table that already exists, you get "Call to undefined function file_directory_path()" which is not the best first impression of Drupal. There should be an accurate error message saying something like, "Table whatever already exists. Please choose another prefix or database."

RobRoy’s picture

Opened an issue for existing tables at http://drupal.org/node/105697 since it seem the cause is different than this.

ChrisKennedy’s picture

Well, the error isn't due to the table already existing per se. Drupal detected that it had already been installed and tried to output a maintenance page saying that Drupal has already been installed, but it doesn't include file.inc. This is already fixed in the patch I referenced in #10.

ChrisKennedy’s picture

Status: Active » Needs review
StatusFileSize
new604 bytes

Okay, in order to get at least this bug fix committed, here is a one-line patch that only fixes the file_directory_path error.

dries’s picture

Not sure that is the right place to include file.inc. The maintenance page does not require file.inc, as far as I can tell. If the installer requires file.inc, we should probably include it in the installer.

dries’s picture

Looking at this some more, drupal_maintenance_theme() is a really awkward function. I wonder why it can't be implemented as a bootstrap phase. Really, what we are trying to mimick with drupal_maintenance_theme() is a n alternative bootstrap scenario.

Anonymous’s picture

Would the theme still be able to override the default if you moved it to the bootstrap phase?

ChrisKennedy’s picture

@Dries: you're right, it isn't drupal_maintenance_theme() that needs file.inc, but rather theme_install_page(), which gets called by install_already_done_error(). So I think it's best to remove the file.inc inclusion in install_select_profile() and add it at the beginning of install_main(). Here's a patch to do that.

You're right that drupal_maintenance_theme() is an awkward function, but I don't think it can be implemented as a bootstrap phase in the current linear design in which phases can't be executed conditionally, in different orders, or in different combinations. I think the bootstrapping system should be revisited in d6 to be more flexible, if possible.

ChrisKennedy’s picture

StatusFileSize
new904 bytes

Patch.

dries’s picture

Status: Needs review » Fixed

Agreed. Committed to CVS HEAD. Thanks.

t.a. barnhart’s picture

i was upgrading a localhost copy of 4.6 to 5.0RC -- i got this error, but the maintenance patch worked perfectly.

thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)