WordPress “CGI Error” Fix
Software
- WordPress 2.3.3
Server Environment (shared)
- Windows 2003 Server
- IIS 6
- PHP 5.2.5 (CGI/FastCGI)
- MySQL
- Provider: Crystaltech.com
Problem Description
- The following CGI error appears after enabling “Date and name based” permalink structure:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
Solution
Assuming that you do not want to change back to default permalink structure and loose your pretty URLs try the following fixes
- Log Permissions Fix:
- Open file /wp-includes/wp-db.php in your favourite edito
- Around line 163 find the following code:
error_log($error_str, 0) - Replace it with following code:
// begin GamaFX.com CGI ERROR Fix
//ORIGINAL CODE: error_log($error_str, 0);
// end GamaFX.com CGI ERROR Fix - Upload the file and retest the website. If the problem presists, proceed to the next fix
- DB File Replacement Method
- Replace the entire content of /wp-includes/wp-db.php with the code contained in this wp-db.php.txt file
- Upload the file and retest the website. If the problem presists, proceed to the next fix
- Plugin Fix
- Redirect your custom 404 error page to index.php
If you are hosted with Crystaltech Hosting, please see the screenshot - Download the WordPress – Remove Index.php from Permalinks in IIS Plugin (scroll down), and install it into wordpress (upload to /wp-content/plugins/ folder)
- Remove index.php from your custom permalink structure by going to Options > Permalinks
- Activate the “Remove Index.php” plugin from WordPress control panel Plugins page.
- Redirect your custom 404 error page to index.php