WordPress.org

Ready to get started?Download WordPress

Forums

CGI Error With Pages (31 posts)

  1. slamb0513
    Member
    Posted 6 years ago #

    I have pages on my site that once I published were given the URLs of http://www.twomomsdaycare.com/?p=2 for example. When this link is clicked, all it does is redirect back to the home page. When I use permalinks, the blog posts themselves work fine, but the pages throw the following CGI Error.

    CGI Error
    The specified CGI application misbehaved by not returning a complete set of HTTP headers.

    Can someone help me with this?

  2. slamb0513
    Member
    Posted 6 years ago #

    Anyone? When I don't use permalinks, I get URLs created that look like the following:

    http://www.twomomsdaycare.com/?page_id=2

    All that link does is take you back to the home page.

    If I modify the URL myself in the address bar to add index.php before the ? so it reads http://www.twomomsdaycare.com/index.php?page_id=2 then everything links fine.
    Does anyone know what file and where in the code these links are generated so I can physically add the index.php before the ?

    Any help would be really appreciated.

  3. slamb0513
    Member
    Posted 6 years ago #

    Bueller? Bueller? Anyone? Anyone?

  4. drmiketemp
    Member
    Posted 6 years ago #

    Actually the question to ask is why CGI is coming into play. WP is a php script, not cgi.

    Best bet would be to get with your host and see if it's something on their end.

  5. omnivore
    Member
    Posted 6 years ago #

    I've never had this problem before. But it's cropped up constantly since I installed WordPress version 2.3.1. It's not a php problem, but it causes some serious problems on IIS apparently.

  6. lionking06
    Member
    Posted 6 years ago #

    ===
    replace code in your wp-includes/wp-db.php with the code below...

    This fix is for 2.3 and 2.3.1

    Feb 5, 2008
    [moderated code placed at http://wordpress.pastebin.ca/893007 ]

  7. BrianF
    Member
    Posted 6 years ago #

    FYI, this just worked for me to get WP 2.3.2 working too. Host is a Windows shop.

  8. RAHULROCX
    Member
    Posted 6 years ago #

    This worked perfectly 4 me
    thnk u

  9. ghenghiz
    Member
    Posted 6 years ago #

    This fix the error but... it makes me to re-install wordpress!

    is there any other way?

  10. MrBim
    Member
    Posted 6 years ago #

    Indeed this works ...

    I am running:
    -Windows 2008 Standard edition (full)
    -PHP 5.2.5 with FastCGI
    -MySQL 5.0.45
    -WP 2.3.2

    I don't see why WordPress has difficulties installing. I have installed Joomla and Invision Power Board without any problems.

    Thanks for the code!

  11. martin6
    Member
    Posted 6 years ago #

    Hi,

    I am running the similar problem here. When I go to the url that suggested above "http://wordpress.pastebin.ca/893007", it returns blank page.

    Can anyone let me know where to modify the codes?

    Thanks

    Martin

  12. MichaelH
    Member
    Posted 6 years ago #

    This link works for me:
    http://wordpress.pastebin.ca/893007

  13. MichaelH
    Member
    Posted 6 years ago #

    Connecting the dots... http://trac.wordpress.org/ticket/5951

  14. martin6
    Member
    Posted 6 years ago #

    Hi,

    Thanks for the reply. I am still unable to see anything on that link:
    http://wordpress.pastebin.ca/893007 which returns blank page.

    I used both firefox and IE but see the same result.

    Any suggestion will be greatly appreciated.

    Regards

    Martin

  15. swhitley
    Member
    Posted 6 years ago #

    I ran into the same CGI problem. I've been running multiple versions and instances of WordPress with the same host for two years without issue, but the install failed for 2.3.3.

    I updated wp-db.php with the code above and it worked.

  16. stefanrusek
    Member
    Posted 6 years ago #

    I have a wordpress 2.3.3 install running on IIS. When I enable permalinks with dates and article names, then page, tags, and categories give the CGI error. If I choose the permalink option /index.php/archives/%post_id%, then all pages give the CGI error. The above fix seems to fix the problem when you get a CGI error during installation, but it has no effect on already working installs that fail when the permalink options are changed.

  17. stefanrusek
    Member
    Posted 6 years ago #

    This bug is especially bad since each time that wordpress crashes with the cgi error, it leaves the db connection open and it doesn't take long before the website hits the mysql connection limit and everything stops working.

  18. mastermattie
    Member
    Posted 6 years ago #

    I Guess it has somethinh to do with mod_rewrite.
    Apache supports mod_rewrite but IIS don't.

    There's an freeware ISAPI module to use mod_rewrite on iis, but it won't work with .htaccess files and has te be configured per website.

    So, if there's a way to bypass the mod_rewrite part of WordPress it could solve the problem.

  19. starfix
    Member
    Posted 6 years ago #

    I have the same problem and I tried to solve.
    But the url "http://wordpress.pastebin.ca/893007" it returns a blank page too...

  20. tgwilson
    Member
    Posted 6 years ago #

    I'm not technical enough to know why this "worked" for me, but I figured I'd share it in the event that, somehow, it was the root cause. If someone else is able to completely discount this, please do so!

    I was getting the CGI error described here for my RSS feed. I tried the wp-db.php changes...to no avail.

    After backing up my database, deleting all the tables, reinstalling WP, and restoring the database...nothing had changed.

    Then, I started getting a completely unrelated error when I tried to view the blog itself. I could get to the admin area, but couldn't view plain ol' blog content. That error was much easier to troubleshoot -- index.php was referencing "./wp-blog-header.php," which is actually located in the same folder (the root) as index.php.

    I removed the "./" from index.php. Not only did the site start working again, but the RSS feed started working -- no CGI errors!

    I can't connect the dots at all. It doesn't seem like these would be related. But, things are at least working for me again.

  21. tylerstyle
    Member
    Posted 6 years ago #

    This fixed my issue. Though the link with the code above is not working, type in CGI ERROR in the search box and you will receive their new link for it...which is here: http://wordpress.pastebin.ca/924003?srch=cgi+error

    On the bottom of this page, they have the code for you to copy and paste into the file referenced above.

    Hope this helps,
    Richard

  22. MrBean
    Member
    Posted 6 years ago #

    Weird ... I was having this same problem, and I spent quite a bit of time looking for answer (as the previous poster states, the link provided earlier does not work). I ended up using 2.3.1 which did not have this issue. After tyler here posted this new link, I just now attempted to upgrade. I uploaded all the new files as described in the upgrade FAQ, and I did not have to run the upgrade.php as it states that I am now up to date. Is this normal? Should I not have had to do anything from the db side?

    Thanks

  23. lostasylum
    Member
    Posted 6 years ago #

    hi, i'm actually having the same problem. i recently installed wordpress 2.3.3 on my website with the default settings.

    today, i decided to change the permalinks structure from the default: http://simplyblatant.com/wordpress/?p=123

    to

    Date and name based: http://simplyblatant.com/wordpress/index.php/2008/03/28/sample-post/

    and now, everything else i click besides the homepage won't load. it just gives me the error:

    CGI Error
    The specified CGI application misbehaved by not returning a complete set of HTTP headers.

    i've already tried the option here: http://wordpress.pastebin.ca/924003 and it still doesn't work....

    HELP!!

  24. pyrodesign
    Member
    Posted 6 years ago #

    Has anyone managed to figure this out.
    I have tried a couple of the wp-db.php fixes with little or no success.
    Sometimes its working fine and then its gone and back again.

    So I upgraded to 2.5 today and still the same problem.

    Worst thing is there seems to be multiple posts all over the place.

    If I get it going I'll post, hopefully some more can do the same.

  25. jiyue
    Member
    Posted 6 years ago #

    I have also emerged this problem, but no solution.

    What is the reason for this?

  26. bothandstudios
    Member
    Posted 6 years ago #

    Add me to the group of those still getting the CGI error in 2.5 when running anything but the default permalinks. I am on a Windows Box running IIS.

    Is there a solution?

  27. lostasylum
    Member
    Posted 6 years ago #

    to be honest, i've given up trying to look for solutions.. all the solutions i've tried doesn't work.... i guess we'll just have to wait for v2.6 and hope that it would have dealt with this issue by then...

    in the meantime, i have to life with my permalinks not working and hurting my SEO as well i suppose...

  28. strebman
    Member
    Posted 6 years ago #

    any word on a permalink fix? i got the wp-db "fix" code am able to install, but cannot change my permalinks.

    My MySQL db is on a separate box, could that be causing some of the problem?

  29. fdepoort
    Member
    Posted 6 years ago #

    I've exactly the same problem on my site, since I've installed WordPress 2.3. I ve got IIS on MS Windows 2003 Server, php 5.2. I tried each solution in this post and no one fixed my pb ..
    I'm looking for a solution for months, I 've lost more than a half of visitors because of this pb : 40% of hits present the message "CGI Error..."
    I was a fan of WordPress, but since this pb, that nobody can solve, I'm very disappointed.
    I hope someone will find the pb.

  30. Anonymous
    Unregistered
    Posted 5 years ago #

    The fix presented above does not work for WordPress 2.5.1. At least it did not work for me.

Topic Closed

This topic has been closed to new replies.

About this Topic