[wp-trac] Re: [WordPress Trac] #2599: Non-PHP-as-CGI servers never send Trackbacks

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 25 15:16:19 GMT 2006


#2599: Non-PHP-as-CGI servers never send Trackbacks
----------------------------+-----------------------------------------------
       Id:  2599            |      Status:  closed                  
Component:  Administration  |    Modified:  Sat Mar 25 15:16:19 2006
 Severity:  major           |   Milestone:  2.1                     
 Priority:  high            |     Version:  2.0.2                   
    Owner:  anonymous       |    Reporter:  markjaquith             
----------------------------+-----------------------------------------------
Changes (by masquerade):

  * resolution:  => invalid
  * status:  new => closed

Old description:

> I am submitting this ticket for "thermoman" in #wordpress because the new
> forum account he signed up for did now grant him access to Trac.  What
> follows it the report he mailed to me.
>

>

> '''Summary'''
>
> Running PHP __not__ as cgi causes a bug preventing execute-pings.php
> ever being called -> No Trackbacks are ever sent to other blogs.
>
> '''Details'''
>
> Sending Pings/Trackbacks to other blogs are handled by calling
> http://yourdomain.tld/wordpress/wp-admin/execute-pings.php
>
> This URL is to be called on almost every page in the admin section
> via the admin-footer.php file:
>
> {{{
> if ( (substr(php_sapi_name(), 0, 3) == 'cgi') && spawn_pinger() ) {
>    echo '<iframe id="pingcheck" src="' . get_settings('siteurl')
>        .'/wp-admin/execute-pings.php?time=' . time() . '"
>        style="border:none;width:1px;height:1px;"></iframe>';
> }
> }}}
>
> When you're running Apache with mod_php then the above block is never
> being executed since the first condition in the if statement will be
> false resulting in _not_ considering (and executing) the second
> condition (spawn_pinger).
>
> no cgi -> no IFRAME, no spawn_pinger() -> no trackbacks being sent
>
> When fixing this you should also have a look at spawn_pinger() in
> wp-includes/functions.php:
>
> spawn_pinger() only returns a value if php is running as cgi.
> When apache is running mod_php the function returns no value. This has
> to be fixed, too.
>

> '''Workaround'''
>
> Comment out the 'if ( ...)' check in execute-pings.php so the iframe
> is called on every page in the admin section regardless or apache
> running php as cgi or not.
>
> Greetings,
> Marcel.
> (http://www.adminblogger.de/)

New description:

 I am submitting this ticket for "thermoman" in #wordpress because the new
 forum account he signed up for did now grant him access to Trac.  What
 follows it the report he mailed to me.




 '''Summary'''

 Running PHP __not__ as cgi causes a bug preventing execute-pings.php
 ever being called -> No Trackbacks are ever sent to other blogs.

 '''Details'''

 Sending Pings/Trackbacks to other blogs are handled by calling
 http://yourdomain.tld/wordpress/wp-admin/execute-pings.php

 This URL is to be called on almost every page in the admin section
 via the admin-footer.php file:

 {{{
 if ( (substr(php_sapi_name(), 0, 3) == 'cgi') && spawn_pinger() ) {
    echo '<iframe id="pingcheck" src="' . get_settings('siteurl')
        .'/wp-admin/execute-pings.php?time=' . time() . '"
        style="border:none;width:1px;height:1px;"></iframe>';
 }
 }}}

 When you're running Apache with mod_php then the above block is never
 being executed since the first condition in the if statement will be
 false resulting in _not_ considering (and executing) the second
 condition (spawn_pinger).

 no cgi -> no IFRAME, no spawn_pinger() -> no trackbacks being sent

 When fixing this you should also have a look at spawn_pinger() in
 wp-includes/functions.php:

 spawn_pinger() only returns a value if php is running as cgi.
 When apache is running mod_php the function returns no value. This has
 to be fixed, too.


 '''Workaround'''

 Comment out the 'if ( ...)' check in execute-pings.php so the iframe
 is called on every page in the admin section regardless or apache
 running php as cgi or not.

Comment:

 Pinging works fine on non-cgi, the above code is actually a hack to make
 it work on CGI, on mod_php servers this is unneccessary because it would
 spawn the pinger twice. See write_post() for when it is originally called.

 If you can't actually send trackbacks (which I highly doubt, I'm guessing
 you looked at the code and jumped to conclusions), feel free to reopen
 with something more helpful than this.

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


More information about the wp-trac mailing list