When the installer reaches the point, where the database is to be selected, it stops with the following error message:
Warning: glob() expects parameter 2 to be long, string given in [path cut]/htdocs/sites/dev/drupal7/includes/install.inc on line 216

Warning: Invalid argument supplied for foreach() in [path cut]/htdocs/sites/dev/drupal7/includes/install.inc on line 216

Warning: Invalid argument supplied for foreach() in [path cut]/htdocs/sites/dev/drupal7/includes/install.inc on line 222

Warning: Cannot modify header information - headers already sent by (output started at [path cut]/htdocs/sites/dev/drupal7/includes/install.inc:216) in [path cut]/htdocs/sites/dev/drupal7/includes/common.inc on line 141

according to php.net the used parameter glob_brace is not implemented in Sun Solaris systems.
Removing the parameter from the command results in the first 2 error messages disappearing.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dropcube’s picture

Title: Installer can not determine database drivers on Solaris System (used by Strato) » Installer fails on some systems: glob() is not multiplatform.
Assigned: Unassigned » dropcube
Status: Active » Needs review
FileSize
1.13 KB

From the PHP manual http://www.php.net/glob (function glob() ):

-This function isn't available on some systems (e.g. old Sun OS).
-The GLOB_BRACE flag is not available on some non GNU systems, like Solaris.

So, we should use an alternative solution.

The attached patch fixes this by using another alternative technique to detect database drivers.

dropcube’s picture

The same patch, but closing the dir handle.

Anonymous’s picture

Status: Needs review » Needs work

I'm going to suggest a drupal_glob be added to bootstrap.inc so that others can take advantage.

dropcube’s picture

Status: Needs work » Needs review

Where else do we require glob() ? If a module require it, then it can use a simple similar approach to the one proposed in this patch. We also have a file_scan_directory function that can be used for similar purposes.

Damien Tournoud’s picture

Priority: Critical » Normal

1.

$dir = DRUPAL_ROOT . './includes/database';

Should be:

$dir = DRUPAL_ROOT . '/includes/database';

2. This should really use file_scan_directory directly. It does not currently probably because of Crell willingness to keep the database layer completely separate from the rest of Drupal. We should probably generalize fsd() and move it to bootstrap.inc.

dropcube’s picture

Damien, not sure if file_scan_directory can be used to scan directories. It recurse through directories, but only returning files. To detetect database drivers we are looking for directories, not for files. What else do you suggest?

Anonymous’s picture

If $recurse param is FALSE then file_scan_directory will return the directory.

dropcube’s picture

Well, here is a patch that uses file_scan_directory. Work as expected.

randall.vg’s picture

Status: Needs review » Reviewed & tested by the community

This patch applies cleanly to HEAD and works as expected on mac os x leopard and ubuntu.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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