Cron Job error in WordPress Php Functions

Posted on 2012-08-18
Last Modified: 2012-11-21
Hi, while using a Cron Job setup at Go Daddy to run a functions.php file on my self-hosted WordPress site, it does not work and I receive an error message from the Go Daddy system which is below. I cannot figure out what it is trying to tell me, or what I might be doing wrong. Thanks in advance..

Warning: require_once(STYLESHEETPATH/library/filters.php) [function.require-once]: failed to open stream: No such file or directory in

/home/content/32/9737732/html/wp-content/themes/auto-magic-content-robot/functions.php on line 3

Fatal error: require_once() [function.require]: Failed opening required 'STYLESHEETPATH/library/filters.php'

(include_path='.:/usr/local/php5/lib/php') in /home/content/32/9737732/html/wp-content/themes/auto-magic-content-robot/functions.php on line 3
Question by:ksoszka
    LVL 53

    Expert Comment

    It cannot find STYLESHEETPATH/library/filters.php  Probably the path needs more qualification.  Cron runs in the os environment; not the web environment, so you may have to specify the path starting with your root; or it might just want a leading slash:
    /STYLESHEETPATH/library/filters.php  (but that would be too easy).


    Author Comment

    Hi, thank you - I went with the full path, and the original errors were replaced by this:

    Fatal error: Call to undefined function add_filter() in /home/content/32/9737732/html/wp-content/themes/auto-magic-content-robot/library/filters.php on line 62

    Line 62 of the filters.php file that it refers to is:

    add_filter('arras_postheader', 'my_postheader');

    I sense that this might cascade if we keep going, so here is some background info in case there is an obvious root to the problem...

    I am using a theme (auto-magic-content-robot) which is a child theme of the "Arras" theme. The functions file of the child theme contains programming which is designed to run with wp scheduled events. It worked fine, until I sold the site and moved it from my own Go Daddy hosting to the buyer's Go Daddy hosting. The Cron Job is an attempt to see if I could get it to work again. I have had this happen before when I move one of these sites. Apparently I should do something differently somewhere, either in the moving process or in the code.

    I should also add that if I manually run the programming that is set up to use wp scheduled events, it works. Only the ability to make it run automatically is not working.
    LVL 53

    Accepted Solution

    Well, it is almost certainly a path problem.  There may be additional errors.  I am not familar with the themes you are using but probably in the filters.php there is a definition of the function and it failed.

    Anywhere there is a hard coded path there could be an issue and the only way to fix it is to dig through and determine how the path has to be changed.

    I avoid these kind of problems by putting the top part of all paths in my startup functions that I load in every page. Then I can reference everything using thos paths in fron of low level directories and files.  When the site gets moved all I have to do is change the high level paths.

    You also might want to see what kind of a hosting account that the user has.  Not all accounts have all the same features just because they are with the same host, and there could be limits that you don't have on your account.

    As you find the problems you probably want to make sure you document them so that if you have to do a move like this again you already know how to fix it.


    Author Comment

    Thank you, I will look at the filters.php to see if there is a definition of the function that may be failing.
    LVL 70

    Expert Comment

    by:Jason C. Levine
    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    WordPress is constantly evolving, and with each evolution appears to get better and better.  One of the big drawbacks prior to version 3 was that there was no way to be able to set up a custom menu from the backend. The Old Way Adding menus is…
    If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
    The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now