1

One of the php sites hosted on my shared linux/Apache server keeps getting random 500 Internal Server Error, while other sites never encounter any issues. The server error log shows:

Handler for fastcgi-script returned invalid result code 1 Connection reset by peer: FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: read failed

Is this an application specific issue or server configuration issue? Thanks!

1
  • It looks like you probably have a permission issue.
    – Joe P.
    Jan 18, 2018 at 1:59

1 Answer 1

0

It seems your script is over max_execution_time. Maybe 360s

It could be very useful to get which function is consuming most of the execution time. You can use the slow log of php-fpm.

In your pool file (/etc/php5/fpm/pool.d/www.conf) look for:

  • 'slowlog', and add a log file like: '/var/log/php-fpm/www.log.slow'
  • 'request_slowlog_timeout', and add a time like: '10s'

Restart php-fpm, tailf this file and maybe you could trace your huge function.

1
  • Thank you! Will give it a try.
    – yma
    Jan 24, 2018 at 3:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.