WordPress.org

Ready to get started?Download WordPress

Forums

Fatal error: Failed opening required... (20 posts)

  1. DavidDeCristoforo
    Member
    Posted 9 years ago #

    Well I didn't get too far! Trying to hit:
    http://www.naturalfoodworks.com/weblog/wp-admin/install.php

    returned:
    Fatal error: Failed opening required '//wp-settings.php' (include_path='.:/usr/local/lib/php') in //wp-config.php on line 31

    Anyone?
    Thanx in advance
    DD
    PS Please be specific...I'm a moron!

  2. ZephyrSky
    Member
    Posted 9 years ago #

    Looks like it's having trouble with the absolute path of your install. In wp-config.php it tries to include wp-settings.php:

    define('ABSPATH', dirname(__FILE__).'/');

    // Get everything else
    require_once(ABSPATH.'wp-settings.php');
    ?>

    First of all does wp-settings.php exist? a quick way to test if the path to this file is correct is to temporarily change the above to:

    define('ABSPATH', dirname(__FILE__).'/');

    // Get everything else
    echo ('Path to wp-settings: '.ABSPATH.'wp-settings.php');
    exit;
    ?>

    This will print the path to the screen and then you'll be able to verify if the path is correct.. Then change the code back to what it was. If the path is correct then change:

    require_once(ABSPATH.'wp-settings.php');

    TO:
    include('../wp-settings.php');

    Hope this helps. Post back with your findings.

  3. ZephyrSky
    Member
    Posted 9 years ago #

    I also don't want to steer you wrong.. I've never had a problem installing WordPress. It should work, so what I gave you was a cheap hack to possibly get you over this little hump. I have a feeling if you're having a problem this early in the install this hack won't help becuase you might run into other problems before it's done.

    Good luck

  4. DavidDeCristoforo
    Member
    Posted 9 years ago #

    OK that showed the path as:
    Path to wp-settings: //wp-settings.php

    So I changed the code to:

    define('ABSPATH', dirname(__FILE__).'/');

    // Get everything else
    require_once(ABSPATH.'//wp-settings.php');
    ?>

    But that returned:
    Fatal error: Failed opening required '////wp-settings.php' (include_path='') in //wp-config.php on line 31

    Don't know where all the extra slashes came from....

    Thanx
    DD

  5. ZephyrSky
    Member
    Posted 9 years ago #

    To hack it, I was suggesting you change:
    // Get everything else
    require_once(ABSPATH.'wp-settings.php');

    TO:
    // Get everything else
    include('../wp-settings.php');

    But try this first. Something is doubling up the forward slash. I thought the server was smart enough to ignore an extra slash but maybe not. Change:
    define('ABSPATH', dirname(__FILE__).'/');

    TO:
    define('ABSPATH', dirname(__FILE__));

  6. DavidDeCristoforo
    Member
    Posted 9 years ago #

    Rats! This:
    define('ABSPATH', dirname(__FILE__));

    // Get everything else
    include('//wp-settings.php');

    Gets:
    Warning: Failed opening '//wp-settings.php' for inclusion (include_path='.:/usr/local/lib/php') in //wp-config.php on line 31

    Fatal error: Call to a member function on a non-object in /wh60319/public_html/weblog/wp-admin/install.php on line 52

    Is this getting worse?

    DD

    PS Thanx

  7. ZephyrSky
    Member
    Posted 9 years ago #

    Sorry for the bantering back and forth but leave out the forward slashes in the include:
    -----------------
    define('ABSPATH', dirname(__FILE__));

    // Get everything else
    include('//wp-settings.php');

    CHANGE TO:
    --------------
    define('ABSPATH', dirname(__FILE__));

    // Get everything else
    include('wp-settings.php');

    Personally I don't think the absolute path is working so it can't find the location of the file on the server. By changing to the include statement it will try to find it relative to your website directory. wp-config.php & wp-settings.php are in the same directory, so you won't need any path information in front of it if you use include.

    If you know the server path to your web directory you could put everything back the way it was and hardcode your absolute path that way any other stuff needing the absolute path will be correct. But try the above first.
    ----------------------
    define('ABSPATH', '/DIR/PATH/TO/WEB/DIRECTORY/';

    Good luck.

  8. DavidDeCristoforo
    Member
    Posted 9 years ago #

    Well I don't know why you should be sorry...you're the one helping me! Anyway that didn't work either. I keep getting one of the two errors....I've tried all manner of varaitions on the path but there's just no joy...

    What I cant understand is why the path is an issue since all of the files reside in the same dir...

    DD

  9. ZephyrSky
    Member
    Posted 9 years ago #

    I agree.. If you've still got the will after all this, put everything back to normal then throw this in:
    ----------------
    echo ('Path to wp-settings: '.ABSPATH.'wp-settings.php');
    exit;

    AFTER:
    ---------
    define('ABSPATH', dirname(__FILE__).'/');

    Let me know what it says.

  10. DavidDeCristoforo
    Member
    Posted 9 years ago #

    define('ABSPATH', dirname(__FILE__).'/');

    echo ('Path to wp-settings: '.ABSPATH.'wp-settings.php');
    exit;

    // Get everything else
    require_once(ABSPATH.'wp-settings.php');

    Gets me back to:
    Path to wp-settings: //wp-settings.php

    Grrrrr
    DD

  11. ZephyrSky
    Member
    Posted 9 years ago #

    Actually that's a good sign.. At least you know now that the ABSPATH thing isn't working.. Are you doing this on a hosted webserver? If so, find out from them the full path to the directory where WordPress has been installed, then rewrite this:
    -------------
    define('ABSPATH', dirname(__FILE__).'/');

    To be this:
    -------------
    define('ABSPATH', '/PATH/TO/YOUR/WORDPRESS/');

    Change /PATH/TO/YOUR/WORDPRESS/ to the path they give you. Make sure to put that single forward slash at the end of the path. Also make sure to remove:
    -----------
    echo ('Path to wp-settings: '.ABSPATH.'wp-settings.php');
    exit;

    Before doing the above.. This will ensure that WordPress knows exactly where the files are it's looking for. I think I've reached the end of my ideas.. Good luck and let me know if it works.

  12. DavidDeCristoforo
    Member
    Posted 9 years ago #

    Well I appreciate your help. But even with the full absolute path the file fails to open. I have tried reinstalling the entire package and reconfiguring the config file but nothing seems to work. If I can't even get past this first problem, maybe this is not the right software for me. It's already cost me a full day and an evening. I think I am going to have to try something else unless anyone has any other ideas. Thanx again for all your kind help.

    DD

  13. NuclearMoose
    Member
    Posted 9 years ago #

    Fatal error: Failed opening required "http://www.naturalfoodworks.com/public_html/weblog/
    wp-settings.php"

    Where is the /public_html/ coming from?

    EDIT: What are your server specs? Apache? IIS? PHP version? MySQL version? Visa card number?

  14. morganiq
    Member
    Posted 9 years ago #

    I noticed an entry in the PHP 4 changelog which indicates that a bug in dirname() was fixed way back in PHP 4.0.3 — which is still below the minimum requirements for WordPress.

    Do you know what version of PHP you have? If not, create a file called phpinfo.php in the root directory of your website and add the contents:

    <?php phpinfo() ?>

    Save the file and load http://www.naturalfoodworks.com/phpinfo.php in your browser to view your PHP specs. Check that the version number is at least 4.1.

  15. DavidDeCristoforo
    Member
    Posted 9 years ago #

    OK
    PHP 4.2.3
    MySQL Version 11.15 Distribution 3.23.43
    "For UNIX, we use Sun Microsystem's Solaris 7 operating system"
    I can't find ny refrence to Apache...could this be my problem? Like I said before, I'm a moron so I am most likely in over my head anyway....

    DD

  16. DavidDeCristoforo
    Member
    Posted 9 years ago #

    Addendum...

    My hosting service tells me that I have Apache 1.3 running.

    DD

    PS They also said that I do not have access to anything above my site root (public_html)

  17. DavidDeCristoforo
    Member
    Posted 9 years ago #

    This just in from my hosting service tech support:

    The version of Apache running on your server is 1.3. The full path to your home directory is:
    /home/wh60319/public_html.

    The version of PHP on the server is 4.2.0. Despite the requirements stating that only version 4.1 is needed, I don't believe WordPress will run with PHP 4.2.0, due to a problem with how PHP reports the $_SERVER["SCRIPT_FILENAME"] superglobal variable when being called from within an include file.

    Sorry about not providing all of this in one post...it's been a crazy morning!
    Thanx to all
    DD

  18. DavidDeCristoforo
    Member
    Posted 9 years ago #

    Here's the server config:

    PHP 4.2.3
    MySQL Version 11.15 Distribution 3.23.4
    Apache 1.3
    Full path to home directory is: /home/wh60319/public_html.

    Tech support says:

    The version of PHP on the server is 4.2.0. Despite the requirements stating that only version 4.1 is needed, I don't believe WordPress will run with PHP 4.2.0, due to a problem with how PHP reports the $_SERVER["SCRIPT_FILENAME"] superglobal variable when being called from within an include file.

    Can anyone comment on this? I would love to get past this point. I have tried all of the above recomendations to no avail. Should I look for another hosting service? I would like to avoid that if I can but...

    Thanx
    DD

  19. osi
    Member
    Posted 9 years ago #

    I just encountered this problem. I solved it with:

    define('ABSPATH', "/fully/qualified/path/to/install/dir" . dirname(__FILE__));
    require_once(ABSPATH.'wp-settings.php');

    DD, that would be '/home/wh60319/public_html' for you.

  20. osi
    Member
    Posted 9 years ago #

    with PHP 4.2, you might also be hitting http://bugs.php.net/bug.php?id=13936

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.