WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp-load error from wp-cron output in CPanel (7 posts)

  1. JonManness
    Member
    Posted 1 year ago #

    Hi everyone,

    Was wondering if someone could translate this error and an offer a solution.

    Warning: require_once(./wp-load.php): failed to open stream: No such file or directory in /home/[CPANELUSER]/public_html/wp-cron.php on line 26
    
    Fatal error: require_once(): Failed opening required './wp-load.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/[CPANELUSER]/public_html/wp-cron.php on line 26

    Recently disabled wp-cron in the wp-config and set up a cron job to wp-cron.php in CPanel, which is when I saw the output error in CPanel. Don't think I need wp-cron at the moment for any plugins or scheduling (could be wrong about that), but would like to have it stable and ready just in case.

    Thank you for your help!

    -Jon

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    It is required, revert back.

  3. JonManness
    Member
    Posted 1 year ago #

    Wouldn't this error occur if wp-cron was enabled? Or is the error occurring because I disabled it in the config? Still believe the path where it says "Warning: require_once(./wp-load.php)" needs to be changed, but not completely sure.

  4. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Your functions file is (most likely) requiring it - review the codex for what to do to create a custom cron job- it does not require removing the required one.

  5. JonManness
    Member
    Posted 1 year ago #

    Ended up removing "./" from require_once(./wp-load.php) in line 26 in wp-cron.php and now there's no more error. Believe the "./" was making wp-cron look for wp-load in a different directory.

    Hope this helps someone else with a similar error!

  6. Manuel Freund
    Member
    Posted 1 year ago #

    It did - Thanks Jon!

  7. PJ Brunet
    Member
    Posted 1 year ago #

    This error can happen when you try to run wp-cron.php from another directory where wp-cron.php can't find its supporting files

    At least in my case there was nothing to "fix" on line 26.

    Essentially I was trying to run wp-cron.php from a crontab like this:

    php /home/www-data/example.com/wp-cron.php

    My solution was to create a bash script to first change directories and provide me some extra information:

    */10 * * * * root . /etc/wpcron.sh > /dev/null 2>&1

    Full explanation here:

    http://tomakefast.com/when-wp-cron-php-sceduling-fails-3003/

Topic Closed

This topic has been closed to new replies.

About this Topic