php5 5.2.3-1ubuntu6.2 causing problem

Bug #173817 reported by Dulmandakh Sukhbaatar
2
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Invalid
Low
Unassigned

Bug Description

after upgrading php5-cgi from version 5.2.3-1ubuntu6 to 5.2.3-1ubuntu6.2, MediaWiki site configured to run by fcgid stops working. and enabling apache log level debug, I see

[warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[error] [client 202.*.*.*] Premature end of script headers: index.php5, referer: http://url/index.php5

it is production server, so I downgraded the php5 package. After that, web is running again.

Revision history for this message
Kees Cook (kees) wrote :

Hello! Was this with amd64 or i386 architecture? Were any crashes written to /var/crash ? Thanks!

Revision history for this message
Dulmandakh Sukhbaatar (dulmandakh) wrote :

it's amd64. Also latest version of libapache2-mod-php5 is preventing apache to start or so. disabling php5 module I can start apache2 server. Below I attached crash file from apache2.

Revision history for this message
Dulmandakh Sukhbaatar (dulmandakh) wrote :

sorry, there is no crash file on amd64 or production server. later one and crash file is from i386.

Revision history for this message
TJ (tj) wrote :

This is often caused by an incorrect mod_rewrite rule in the VirtualHost container or in the .htaccess file.

Something like this will cause it:

RewriteRule /([a-z0-9]+) /pastebin.php?show=$1

When it should be:

RewriteRule ^/([a-z0-9]+)$ /pastebin.php?show=$1

Turning on RewriteLog will help see the problem, which is that the fcgi Alias is also matched by the RewriteRule and applied; the imprecise regular-expression matches part of the fcgi path and corrupts it:

RewriteEngine on
RewriteLog /home/domain.net/logs/rewrite.log
RewriteLogLevel 9
RewriteRule /([a-z0-9]+) /pastebin.php?show=$1

logs/error.log shows:

[warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[error] [client 1.2.3.4] Premature end of script headers: pastebin.php

logs/rewrite.log shows:

(2) init rewrite engine with requested uri /info.php
(3) applying pattern '/([a-z0-9]+)' to uri '/info.php'
(2) rewrite '/info.php' -> '/pastebin.php?show=info'
(3) split uri=/pastebin.php?show=info -> uri=/pastebin.php, args=show=info
(2) local path result: /pastebin.php
(2) prefixed with document_root to /home/domain.net/domains/pastebin.domain.net/public_html/pastebin.php
(1) go-ahead with /home/domain.net/domains/pastebin.domain.net/public_html/pastebin.php [OK]
(2) init rewrite engine with requested uri /fcgi-bin/php-fcgi-wrapper/info.php
(3) applying pattern '/([a-z0-9]+)' to uri '/fcgi-bin/php-fcgi-wrapper/info.php'
(2) rewrite '/fcgi-bin/php-fcgi-wrapper/info.php' -> '/pastebin.php?show=fcgi'
(3) split uri=/pastebin.php?show=fcgi -> uri=/pastebin.php, args=show=fcgi
(2) local path result: /pastebin.php
(2) prefixed with document_root to /home/domain.net/domains/pastebin.domain.net/public_html/pastebin.php
(1) go-ahead with /home/domain.net/domains/pastebin.domain.net/public_html/pastebin.php [OK]

Revision history for this message
Chuck Short (zulcss) wrote :

Updating status. Is this still a problem for you in hardy?

thanks
chuck

Changed in php5:
importance: Undecided → Low
status: New → Triaged
Daniel Hahler (blueyed)
Changed in php5 (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Chuck Short (zulcss) wrote :

We'd like to figure out what's causing this bug for you, but we haven't heard back from you in a while. Could you please provide the requested information? Thanks!

Revision history for this message
Chuck Short (zulcss) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in php5 (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.