PHP5-FPM not reporting errors to web servers (fastcgi clients, such as nginx)

Bug #1014044 reported by ks07
92
This bug affects 29 people
Affects Status Importance Assigned to Milestone
php
Unknown
Unknown
php5 (Debian)
Fix Released
Unknown
php5 (Ubuntu)
Medium
Unassigned
Precise
Medium
Thomas Ward

Bug Description

[TESTCASE]

 * Cause PHP to throw an error, which would return a 403, 500, etc. Any PHP error or warning should return a message to nginx or webserver error logs. This does not occur, as intended, and was fixed upstream.

[Regression Potential]

 * The upstream patch (attached later in the bug) fixes this, and is a targetted patch to resolve this issue. This patch was included in 5.4.x which was in Debian, and synced to Ubuntu Quantal.

 * Regression potential from this is very low, given it is a highly specific patch.

[Other Info]

 * [Other Info]

* The debdiff contains a fix also for LP Bug 1006738. As that bug is hard to create a test-case for, discussions with Clint Byrum on IRC made a note that for *that* bugfix, it would be a no-test-case bugfix.
 * This bug was not initially tagged with the 'regression' tag. however, it is a regression in Precise from Oneiric.

 -- Thomas Ward <trekcaptainusa-tw>

------

Since updating Ubuntu to 12.04, the included php version contains a bug that causes errors to not be sent upstream to the web server. This error is a regression from the version supplied with Ubuntu 11.10 (5.3.6-13ubuntu3.7 0).

Using php5-fpm version: 5.3.10-1ubuntu3.1

This bug has been reported and patched upstream, but has not yet been included in a release:

https://bugs.php.net/bug.php?id=61045

This bug makes running php5 in fastcgi mode on Ubuntu very problematic, as errors are never reported to the nginx error.log, which impedes debugging. This can be worked around by enabling an independent error log in php.ini, but it would be much simpler for new users if this worked out of the box.

Robie Basak (racb)
Changed in php5 (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Thomas Ward (teward) wrote :

Can you do me a favor and define what errors you're talking about? Are you talking specifically about php-level errors, and not HTTP status code errors (403, 404, 500, 502, etc.)?

Thomas Ward (teward)
tags: added: precise
Revision history for this message
ks07 (gfield145) wrote :

The missing errors are specifically php centric (e.g. PHP Fatal error: Call to undefined function). Nginx's standard HTTP errors are logged as normal (such as 404 not found).

Changed in php5 (Debian):
status: Unknown → Confirmed
Changed in php5 (Debian):
status: Confirmed → Fix Released
Revision history for this message
Chris Smith (chris-nevermind) wrote :

Just chiming in to confirm this bug, error output from PHP as FastCGI is not passed through to the web server. Any chance on a fix being backported?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package php5 - 5.4.4-3ubuntu1

---------------
php5 (5.4.4-3ubuntu1) quantal; urgency=low

  * Merge from Debian unstable. (LP: #1014044) (LP: #1024355)
    Remaining changes:
    - d/rules: Simplify apache config settings since we never build
      interbase or firebird.
    - debian/rules: export DEB_HOST_MULTIARCH properly.
    - Add build-dependency on lemon, which we now need.
    - Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    - Dropped libcurl-dev not in the archive.
    - debian/control: replace build-depends on mysql-server with
      mysql-server-core-5.5 and mysql-client-5.5 to avoid upstart and
      mysql-server-5.5 postinst confusion with starting up multiple
      mysqlds listening on the same port.
    - Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions
      already in universe.
    - Dropped libonig-dev and libqgdbm since its in universe. (libonig MIR
      has been declined due to an inactive upstream. So this is probably
      a permanent change).
    - modulelist: Drop imap, interbase, sybase, and mcrypt.
    - debian/rules:
      * Dropped building of mcrypt, imap, and interbase.
      * Install apport hook for php5.
      * stop mysql instance on clean just in case we failed in tests

php5 (5.4.4-3) unstable; urgency=low

  * Update ucf/ucfr scripts to not conflict between mysql and mysqlnd
    extension (Closes: #678371)

php5 (5.4.4-2) unstable; urgency=high

  * Fix PHP5-FPM not reporting errors to web server (nginx)
    (Closes: #677994)
  * Bump urgency to high to replace the RC2 version in testing sooner.
 -- Clint Byrum <email address hidden> Mon, 23 Jul 2012 11:08:52 -0700

Changed in php5 (Ubuntu):
status: Triaged → Fix Released
Changed in php5 (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Thomas Ward (teward) wrote :

Assigned this to myself, as I will generate a debdiff for this so it can be SRU'd.

description: updated
Changed in php5 (Ubuntu Precise):
assignee: nobody → Thomas Ward (trekcaptainusa-tw)
status: Triaged → In Progress
Revision history for this message
Thomas Ward (teward) wrote :

So apparently i can't download the patch from here. I'll upload it later. The link to the patch is here though, for 5.3 (which is in Precise):

https://bugs.php.net/patch-display.php?bug_id=61045&patch=bug61045-5.3.patch&revision=latest

description: updated
Revision history for this message
Thomas Ward (teward) wrote :

Upstream patch.

Revision history for this message
Thomas Ward (teward) wrote :

The debdiff for both this bug (LP Bug 1014044), and LP Bug 1006738 for Precise is attached.

This was generated based off of the package in precise-security and precise-updates, php5 5.3.10-1ubuntu3.2.

This debdiff includes patches based upstream for both bugs, and includes a new changelog entry.

*** The patch for Bug 1006738 that is included with this debdiff originated upstream. This upstream patch has already been applied upstream. This patch will show up in Quantal after it exists in Debian, after a sync occurs. ***

Revision history for this message
Thomas Ward (teward) wrote :

Sponsors team: You will need to review both this bug, and LP Bug 1006738. Clint Byrum had suggested that Bug 1006738 should be fixed in Precise since it was fixed upstream (see comments on that bug). On IRC, in #ubuntu-server, it was suggested I include that fix with the fix for this bug here, and in effect kill two bugs with one stone (so to speak).

Thomas Ward (teward)
description: updated
tags: removed: cgi error logging nginx
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Uploaded debdiff (with minor format cleanups to changelog) to precise-proposed. Thanks Thomas for getting this done! It is now awaiting SRU team approval.

Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello ks07, or anyone else affected,

Accepted php5 into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/php5/5.3.10-1ubuntu3.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in php5 (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Thomas Ward (teward) wrote : Re: PHP5-FPM not reporting errors to web server (nginx)

I tested this directly from the precise-proposed repos, and this did indeed fix the issue. PHP was correctly reporting errors to the webserver error logs (tested in nginx).

------
Thomas Ward

tags: added: verification-done
removed: verification-needed
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote : Re: PHP5-FPM not reporting errors to web server (nginx)

This bug was fixed in the package php5 - 5.3.10-1ubuntu3.3

---------------
php5 (5.3.10-1ubuntu3.3) precise-proposed; urgency=low

  * Applies upstream bug fixes for several issues and bugs:
    * php5-fpm segfaults with error 4 in libc-2.15.so
        (LP: #1006738. Bug Priority: High)
    * PHP5-FPM not reporting errors to web server (nginx)
        (LP: #1014044. Bug Priority: Medium)
 -- Thomas Ward <email address hidden> Tue, 31 Jul 2012 21:15:08 -0400

Changed in php5 (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Everaldo Canuto (ecanuto) wrote :

So, when this fix will be available at precise-updates?

Revision history for this message
Thomas Ward (teward) wrote :

This fix was put in precise-updates well over a month ago, Everaldo. The post before yours shows where this was committed to precise-updates (it says precise-proposed, but it is in -updates).

Thomas Ward (teward)
summary: - PHP5-FPM not reporting errors to web server (nginx)
+ PHP5-FPM not reporting errors to web servers (fastcgi clients, such as
+ nginx)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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