[wp-trac] [WordPress Trac] #4566: Cron Not Getting Called (fsockopen failing)

WordPress Trac wp-trac at lists.automattic.com
Fri Jun 29 17:16:36 GMT 2007


#4566: Cron Not Getting Called (fsockopen failing)
----------------------------+-----------------------------------------------
 Reporter:  chewblocka      |       Owner:  anonymous  
     Type:  defect          |      Status:  new        
 Priority:  high            |   Milestone:             
Component:  Administration  |     Version:  2.2.1      
 Severity:  major           |    Keywords:  cron future
----------------------------+-----------------------------------------------
 This is similar to ticket #3565 and #3742, however slightly different.
 The first ticket was solved as a DNS issue, though that is not the case
 here.  The second...the fsockopen is actually working and the user is
 seeing other errors.  In this case, the wp-cron.php is never getting
 called (no entries in the apache access or error logs).  The DNS
 resolution works like a charm.  What is happening though is the fsockopen
 call in cron.php is failing with a connection refused error.  The reason
 for this is that the firewall on the box is denying any request coming
 over the external interface claiming to originate from the current host.
 This is a fairly common firewall rule to deny spoofed IP packets.
 However, currently when cron.php attempts to do an fsockopen using the
 site_url, this is exactly what it is doing.

 I propose the following solution:

 Change cron.php to use the loopback interface in all instances (which is
 how I have solved the issue for my installation).  This would involve
 doing the following:
  * Still get the site_url variable to obtain the ''scheme'' and ''path''
  * Replace $parts['host'] in the fsockopen command with ''localhost''

 This should be the default functionality, though may be beneficial to have
 a selection somewhere that will use the current functionality if
 desired/required.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4566>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list