Title: problems running under php/fastcgi
Last modified: August 18, 2016

---

# problems running under php/fastcgi

 *  [scruby](https://wordpress.org/support/users/scruby/)
 * (@scruby)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/problems-running-under-phpfastcgi/)
 * FastCGI is very picky about there being only one “Status” header being sent from
   apps. So, if like me you are running wordpress under php/fastcgi, you get errors
   like this:
 * [Sat Apr 01 23:30:42 2006] [error] [client 66.215.220.80] FastCGI: comm with 
   server “/var/www/fcgi-php/php” aborted: error parsing headers: duplicate header‘
   Status’
 * This behavior is discussed on php bugs:
    [http://bugs.php.net/bug.php?id=36705](http://bugs.php.net/bug.php?id=36705)
 * According to php bugs, the resolution to this problem is at the programming level.
 * In wordpress, in file /wp-includes/functions.php there is the following two lines
   of code:
 * [@header](https://wordpress.org/support/users/header/)(“Status: $header $text”);
   
   [@header](https://wordpress.org/support/users/header/)(“HTTP/1.1 $header $text”);
 * In order to make wordpress play nicely with fastcgi, I had to replace those two
   lines with the following four lines:
 * if (substr(php_sapi_name(), 0, 3) == ‘cgi’)
    [@header](https://wordpress.org/support/users/header/)(“
   Status: $header $text”); else [@header](https://wordpress.org/support/users/header/)(“
   HTTP/1.1 $header $text”);
 * I’m hoping that the wordpress developers will incorporate this change into the
   next update of wordpress.

Viewing 3 replies - 16 through 18 (of 18 total)

[←](https://wordpress.org/support/topic/problems-running-under-phpfastcgi/?output_format=md)
[1](https://wordpress.org/support/topic/problems-running-under-phpfastcgi/?output_format=md)
2

 *  [ejm](https://wordpress.org/support/users/llizard/)
 * (@llizard)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/problems-running-under-phpfastcgi/page/2/#post-368200)
 * Excuse me for replying to myself…
 * I also found I had to put the 404 page into the root folder of wordpress, which
   is why I was getting error messages on the 404.php
 * To get my 404.php to work, I had to remove all instances of `<?php bloginfo('
   name'); ?>` and `<?php _e('search '); ?>` because of course, those functions 
   will only work if the php page is in the theme folder…
 * I have now switched to using 404.php
 * However, because of the addition to the .htaccess file, I cannot use the following
 * `The page you were looking for at <strong>http://<?php echo $HTTP_HOST.$REQUEST_URI;?
   ></strong> does not exist on this site. Please check for typo(s)`
 * because it merely shows that ../404.php has been requested….
 * Anyone know how I can get the 404 page to work correctly?
    (I’m running WordPress
   2.0.7)
 *  [ejm](https://wordpress.org/support/users/llizard/)
 * (@llizard)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/problems-running-under-phpfastcgi/page/2/#post-368202)
 * Please excuse me for replying to myself one last time… I was looking around in
   this forum and found the answer here:
    [http://wordpress.org/support/topic/102841#post-507098](http://wordpress.org/support/topic/102841#post-507098)
 * which pointed me to
    [WordPress codex: Creating_an_Error_404_Page](http://codex.wordpress.org/Creating_an_Error_404_Page)
 * Using the instructions on that page, I put
    `<?php header("HTTP/1.1 404 Not Found");?
   >` at the top of my 404.php and the following in the body of 404.php:
 *     ```
       Whatever it is you were looking for at
       <strong>http://mydomainname<?php echo $_SERVER['REQUEST_URI']; ?></strong>
       does not exist here.
       Please check for typo(s) and/or use the search engine located on this page
       ```
   
 * and then uploaded the 404 file in my theme folder.
 * I then added the following to the .htaccess file that is in the blog root folder:
 * `ErrorDocument 404 /wordpress/index.php?error=404`
 * The 404 is now working as I had hoped and I believe this issue can be marked 
   resolved.
 *  [cheese500](https://wordpress.org/support/users/cduke250/)
 * (@cduke250)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/problems-running-under-phpfastcgi/page/2/#post-368203)
 * Also read
 * [FastCGI on DreamHost](http://www.askapache.com/2006/dreamhost/fastcgi-on-dreamhost.html)
 * And dont ever pass a full url to ErrorDocument 404 because it will lose all the
   REDIRECT variables in apache.

Viewing 3 replies - 16 through 18 (of 18 total)

[←](https://wordpress.org/support/topic/problems-running-under-phpfastcgi/?output_format=md)
[1](https://wordpress.org/support/topic/problems-running-under-phpfastcgi/?output_format=md)
2

The topic ‘problems running under php/fastcgi’ is closed to new replies.

## Tags

 * [fastcgi](https://wordpress.org/support/topic-tag/fastcgi/)

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 18 replies
 * 10 participants
 * Last reply from: [cheese500](https://wordpress.org/support/users/cduke250/)
 * Last activity: [19 years, 3 months ago](https://wordpress.org/support/topic/problems-running-under-phpfastcgi/page/2/#post-368203)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
