# PHP dying

**URL:** <https://www.ruby-forum.com/t/php-dying/181484>\
**Category:** NGINX\
**Created:** [January 12, 2010, 5:36pm UTC](https://www.ruby-forum.com/t/php-dying/181484 "2010-01-12T17:36:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![djeyewater](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/71e660/32.png) [@djeyewater](https://www.ruby-forum.com/u/djeyewater)\
**Post date:** [January 12, 2010, 5:36pm UTC](https://www.ruby-forum.com/t/php-dying/181484/1 "2010-01-12T17:36:41Z")

</div>

This isn’t really an Nginx problem, but hopefully someone can help me.  
I’m running PHP as fcgi using spawn-fcgi.

I have a PHP script that resizes an image, but when I try to access this  
page, it seems to get partway through processing the page, then the PHP  
process handling the request dies. I receive in the browser the output  
of the script as far as it got, and in the error log I get:

2010/01/12 15:29:33 7654#0: \*15 readv() failed (104: Connection reset  
by peer) while reading upstream, client: 127.0.0.1, server:  
[www.photosite.com](http://www.photosite.com), request: “POST /admin/upload.xhtml HTTP/1.0”,  
upstream:  
“fastcgi://unix:/home/djeyewater/webapps/spawn-fcgi/php-fastcgi.sock:”,  
host: “[www.photosite.com](http://www.photosite.com)”, referrer:  
“[Website Hosting - Mysite.com](http://www.photosite.com/admin/upload.xhtml)”

Other php pages work okay.

I’m guessing I need to change a timeout or max size setting somewhere?

Thanks

Dave

Posted at Nginx Forum:

> **[PHP dying](https://forum.nginx.org/read.php?2,40290,40290#msg-40290)**
>
> This isn't really an Nginx problem, but hopefully someone can help me. I'm running PHP as fcgi using spawn-fcgi. I have a PHP script that resizes an image, but when I try to access this page, it seems to get partway through processing the page, then...

---

<div class="post-metadata">

**Author:** ![djeyewater](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/71e660/32.png) [@djeyewater](https://www.ruby-forum.com/u/djeyewater)\
**Post date:** [January 12, 2010, 7:44pm UTC](https://www.ruby-forum.com/t/php-dying/181484/2 "2010-01-12T19:44:17Z")

</div>

Probably you need to examine PHP logs (or even spawn-fcgi logs/output  
to stderr) - problem should be clearly visible there. There are really  
lots of reason for PHP to die 🙂

On Tue, Jan 12, 2010 at 11:36 PM, djeyewater [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Thanks
> 
> Dave

–  
Aleksej Besciokov  
EMail/JID: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
phone: +7 495 7853149

---

<div class="post-metadata">

**Author:** ![djeyewater](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/71e660/32.png) [@djeyewater](https://www.ruby-forum.com/u/djeyewater)\
**Post date:** [January 12, 2010, 11:24pm UTC](https://www.ruby-forum.com/t/php-dying/181484/3 "2010-01-12T23:24:26Z")

</div>

## proforg Wrote:

> Probably you need to examine PHP logs (or even  
> spawn-fcgi logs/output  
> to stderr) - problem should be clearly visible  
> there. There are really  
> lots of reason for PHP to die 🙂

I added the following to my php.ini:

log\_errors = on  
error\_log = /home/djeyewater/logs/php-errors.log

and modified the spawn-fcgi init script like so:

$FCGI\_DAEMON -s $FCGI\_SOCKET -C $PHP\_FCGI\_CHILDREN -P $FCGI\_PIDFILE –  
$FCGI\_PROGRAM -c /home/djeyewater/webapps/php\_fcgi/lib/php.ini  
2\>\>/home/djeyewater/logs/php-fcgi-err.log

Not sure if that is the correct way to read stderr from spawn-fcgi?

Anyway, after restarting php I got no errors (from the page I’m having  
problems with) recorded in the php error log or the spawn-fcgi stderr  
file. Still get the same error in the nginx error log for the site, and  
obviously the page still isn’t working.

Could you advise me on how I’d get the error message to be recorded?

Thanks

Dave

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,40290,40465#msg-40465](http://forum.nginx.org/read.php?2,40290,40465#msg-40465)
