• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 603
  • Last Modified:

Cron Job error in WordPress Php Functions

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
0
ksoszka
Asked:
ksoszka
  • 2
  • 2
1 Solution
 
COBOLdinosaurCommented:
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).

Cd&
0
 
ksoszkaAuthor Commented:
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.
0
 
COBOLdinosaurCommented:
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.

Cd&
0
 
ksoszkaAuthor Commented:
Thank you, I will look at the filters.php to see if there is a definition of the function that may be failing.
0
 
Jason C. LevineNo oneCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now