WordPress.org

Ready to get started?Download WordPress

Forums

Database and Header error using Lighttpd and FastCGI (7 posts)

  1. tseven
    Member
    Posted 7 years ago #

    I have full control of my server so I decided to run Lighttpd and FastCGI running on Ubuntu server (all latest versions).

    Everything seems to work fine EXCEPT the comment system.

    I've reverted to a 100% default installation of WordPress to eliminate any theme/plugin conflicts.

    When posting a comment I get this error:

    WordPress database error: [MySQL server has gone away]
    SELECT * FROM wp_comments WHERE comment_ID = '13' LIMIT 1
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/publicvent.com/subdomains/t7/httpdocs/blog/wp-includes/wp-db.php:133) in /var/www/vhosts/publicvent.com/subdomains/t7/httpdocs/blog/wp-comments-post.php on line 67
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/publicvent.com/subdomains/t7/httpdocs/blog/wp-includes/wp-db.php:133) in /var/www/vhosts/publicvent.com/subdomains/t7/httpdocs/blog/wp-comments-post.php on line 68
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/publicvent.com/subdomains/t7/httpdocs/blog/wp-includes/wp-db.php:133) in /var/www/vhosts/publicvent.com/subdomains/t7/httpdocs/blog/wp-comments-post.php on line 69
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/publicvent.com/subdomains/t7/httpdocs/blog/wp-includes/wp-db.php:133) in /var/www/vhosts/publicvent.com/subdomains/t7/httpdocs/blog/wp-includes/pluggable.php on line 331

    You may see it live in action here, just try leaving a comment.

    The comment still gets sent to the database and will show up once refreshed.

    I have read around and tried some older fixes I've found, none of which work on 2.2.

    The problem for the header seems to be in how the cookies are handled.

    Even the code of the wp-includes/pluggable.php hint towards this.

    // Cookie safe redirect.  Works around IIS Set-Cookie bug.
    // http://support.microsoft.com/kb/q176113/
    if ( !function_exists('wp_redirect') ) :
    function wp_redirect($location, $status = 302) {
    	global $is_IIS;
    
    	$location = apply_filters('wp_redirect', $location, $status);
    
    	if ( !$location ) // allows the wp_redirect filter to cancel a redirect
    		return false; 
    
    	$location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);
    	$location = wp_kses_no_null($location);
    
    	$strip = array('%0d', '%0a');
    	$location = str_replace($strip, '', $location);
    
    	if ( $is_IIS ) {
    		header("Refresh: 0;url=$location");
    	} else {
    		if ( php_sapi_name() != 'cgi-fcgi' )
    			//status_header($status); // This causes problems on IIS and some FastCGI setups
    		header("Location: $location");
    	}
    }

    As for the database error, this is strange,. the install of MySQL is 100% default. I haven't changed or tweaked a thing.

    ANY suggestions or pointers on how I may resolve these problems will be GREATLY appreciated.

    Thanks in advance,
    Steven

  2. tseven
    Member
    Posted 7 years ago #

    I'm not sure why my post doesn't show up in the search, but thought I'd give it a *bump*.

    Thanks

  3. smatthews
    Member
    Posted 6 years ago #

    I've had this same exact problem on Bluehost. No solution yet, and could use some help also.

    Steve

  4. smatthews
    Member
    Posted 6 years ago #

    Follow up. Works fine once FastCGI is shut down.

  5. mwhistle
    Member
    Posted 6 years ago #

    smatthews, thanks for posting that follow-up. Disabling fastCGI on BlueHost fixed my comment posting problem (same as original poster) and several other issues too. I was just about to re-install WordPress when I found your post. Thanks for saving me the headache.

  6. meonkeys
    Member
    Posted 6 years ago #

    I'm also on Bluehost, using WordPress 2.3.1. Disabling FastCGI fixed anonymous comment posting for me. Thanks!

  7. meonkeys
    Member
    Posted 6 years ago #

    Ticket entered to track this issue: http://trac.wordpress.org/ticket/5382

Topic Closed

This topic has been closed to new replies.

About this Topic