Wordpress wp-cron.php 404 errors

2,331 views
Skip to first unread message

Tony Thomas

unread,
Dec 9, 2009, 11:43:47 AM12/9/09
to Minneapolis St. Paul Wordpress User Group
Hi Everyone,

I'm experiencing some odd behavior with Wordpress' wp-cron.php.

First, I'm getting a 404 error every time wp-cron.php tries to run.
Here is the access log message:

127.0.0.1 - - [09/Dec/2009:10:22:30 -0600] "POST /wp-cron.php?
doing_wp_cron HTTP/1.0" 404 285 "-" "WordPress/2.8.6; http://cvp.umn.edu"

And the corresponding error log message:

[Wed Dec 09 10:22:30 2009] [error] [client 127.0.0.1] script '/var/www/
html/wp-cron.php' not found or unable to stat

Now, wp-cron.php is actually not at '/var/www/html/wp-cron.php', it's
at '/var/www/vhosts/cvp.umn.edu/httpdocs/wp-cron.php'

Does anyone know how Wordpress is getting the file path and how I can
correct that?

I'm not completely convinced this related, but I'm experiencing 2-3
apache restarts per day that seem to coincide with this. It doesn't
restart *every* time I get the above error message, but the restart
times do seem to coincide with *one* of the times of the error
message.

Has anyone else experienced this? Experience troubleshooting it?

Thanks,

Tony

David Newberger

unread,
Dec 9, 2009, 11:53:07 AM12/9/09
to mpls-stpau...@googlegroups.com
Try dropping wp-cron.php into the w-content/plugins directory and see if that fixes it.




--

You received this message because you are subscribed to the Google Groups "Minneapolis St. Paul Wordpress User Group" group.
To post to this group, send email to mpls-stpau...@googlegroups.com.
To unsubscribe from this group, send email to mpls-stpaul-word...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mpls-stpaul-wordpress?hl=en.



Patrick Lewis

unread,
Dec 9, 2009, 2:46:42 PM12/9/09
to mpls-stpau...@googlegroups.com
The problem may be an entry in  the '/etc/hosts' file on the server.  There should be a line like this.

127.0.0.1 localhost.localdomain localhost

If there is also a line like this, that could be the problem.

127.0.0.1 cvp.umn.edu

The entry itself is not bad or wrong, but it can cause problems when a Web request is on the same server.

If the entry is not needed, and can be removed, it may help.  This is of course assuming that this is the problem to begin with.


On Wed, Dec 9, 2009 at 10:43 AM, Tony Thomas <true...@gmail.com> wrote:

Tony Thomas

unread,
Dec 10, 2009, 11:35:08 AM12/10/09
to Minneapolis St. Paul Wordpress User Group
I read a forum or blog post yesterday that claimed that restarting
Apache would just re-insert cvp.umn.edu back into hosts anyway, so I
ignored that fix. That may or may not be true. I didn't try it for
fear of screwing up my Apache configuration. I'm extremely timid with
config file changes and I was working on this at night. I like to
sleep so the prospect of bringing my server to it's knees was a
daunting one. ;-)

After lots of research here's what I've found:

1. wp-cron.php seems to cause problems for lots of people. So much so
that there are occasional reports of hosting services shutting off
hosting because of overuse of server resources.

2. Wordpress seems to (under certain server configurations) look to
run wp-cron.php in the wrong place. In my case it was trying to run at
'/var/www/html/'. That's the DocumentRoot path in /etc/httpd/conf/
httpd.conf (an Apache server configuration file). It should be using
the path in '/etc/hosts' as Patrick pointed out.

3. This problem can be fixed by running wp-cron.php via a crontab on
the server and disabling Wordpress' cron system, but that requires a
higher level of command line experience than a lot of users will have,
a higher level of server access than a lot of users will have AND some
hacks to the core of Wordpress which means that the next Wordpress
upgrade might erase your work.

By yesterday evening I was experiencing several Apache restarts per
hour. My server has a pretty low load with ~200 users who use a web-
based application and a relatively low number of hits to our public
Wordpress site, so Apache, for the most part was able to restart
quickly enough that there were probably few noticeable service
disruptions. Conversely, the load is low enough that the web server
should not have to restart every 15-20 minutes.

I took several steps to alleviate the situation and they seem to have
helped.

First, I ran a couple of command line scripts that MediaTemple makes
available to optimize PHP & MySQL performance.

Next, I installed WP Super Cache (http://ocaoimh.ie/wp-super-cache/)
which reportedly lightens Wordpress' server load considerably. Again,
this plugin requires some command line configuration which a lot of
users may not be comfortable with.

There have been no further Apache restarts since 7pm last night. I
can't be sure yet if my fixes worked or if it's just because the
server load is typically very light at night. So far, so good this
morning.

In the interest of complete disclosure, I can't be totally certain
Wordpress was causing the problem since I run another PHP/MySQL
application on the same server. BUT, the restarts did coincide w/
incorrectly routed requests to run wp-cron.php AND there are quite a
few blog and forum posts out there about problems with wp-cron.php and
server problems, so I think it's a likely candidate.
> > mpls-stpaul-word...@googlegroups.com<mpls-stpaul-wordpress%2B unsub...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages