WordPress.org

Ready to get started?Download WordPress

Forums

Fatal error: Cannot redeclare glob (8 posts)

  1. fallen
    Member
    Posted 8 years ago #

    I´m trying a fresh install of 2.0RC1, and all that I get is:

    [code]
    Fatal error: Cannot redeclare glob() in /DISK4/WWW/mywpsite.com/wordpress/wp-includes/functions-compat.php on line 95
    [/code]
    Any ideas?

    Thx!

    PS: Running on Apache 2.0.55, PHP 5.0.5, MySQL 4.1.15, eAccelerator 0.9.3

  2. stevenhb
    Member
    Posted 8 years ago #

    well, if you look at the code (functions-compat.php) you'll see that the function declaration of glob() only will be declared if a declaration of glob doesn't already exist.

    currently:

    if( !(function_exists('glob')) ):
    function glob($pattern) {

    and so on. Now I don't know if this actually will help you out, but try to rewrite the condition to:
    if(!function_exists('glob')) {
    function glob($pattern) {
    ...
    } // end of glob()
    } // end of condition

  3. fallen
    Member
    Posted 8 years ago #

    I don´t know if this is the best solution, but after commenting the entire sentence, install process was ok.

  4. mattlock
    Member
    Posted 8 years ago #

    Hi, I have the same problem and I try rewrite the condition in functions-compat.php, but nothing changed.

    Don´t you have any ideas? Thank you very much for each advice!

    Fatal error: Cannot redeclare glob() in /DISK3/WWW/petrbenadik.com/redesign/wp-includes/functions-compat.php on line 95

  5. OzzyQ
    Member
    Posted 8 years ago #

    I have same problem with globe function.

    1. You must rename function globe() in functions-compat.php for example to globeX
    ... function globX($pattern) { ...

    2. You must open cache.php and find text globe( and replace this by globeX(

  6. twinky
    Member
    Posted 8 years ago #

    I had the same problem and did what OzzyQ suggested. Installation went ok but after it when I log in as admin I see the following errors:

    Warning: glob() has been disabled for security reasons in /DISK2/WWW/....

    Please can someone help?

  7. petit
    Member
    Posted 8 years ago #

    But fallen, why WP 2 RC1?
    Hmm - sorry, old thread!

  8. twinky
    Member
    Posted 8 years ago #

    I use stable version of WP 2, I added the question here to this topic because it is what I think caused prob.

    Anyway I solved it by editing file wp-includes/functions.php and change row 1785 from:

    $screenshot = glob("$theme_root/$stylesheet/screenshot.*");

    to

    $screenshot = globX("$theme_root/$stylesheet/screenshot.*");

Topic Closed

This topic has been closed to new replies.

About this Topic