500 Internal Server Error Laravel - php

Sometimes i got this error: 500 Internal Server Error
My PHP Version 5.4.4-14+deb7u14
My Laravel Version "laravel/framework": "4.2.*"
Apache Server
My DocumentRoot & Directory in httpd.conf is set to: /usr/local/sites/mysite-laravel/public
My server logs:
(104)Connection reset by peer: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Mon Sep 01 14:52:33 2014] [error] mod_fcgid: process /var/www-data/fcgi-bin/php5-fcgi(25404) exit(communication error), get unexpected signal 11
Does anyone know about this? or is this is what happens in Laravel 4?

Make sure your folders have 755 permission. I cleared this issue with permission. This is first thing do any others. You can get successful output.
Thanks

If you are using a .htaccess on your site, it may be interfering with the web page you are trying to load into your browser. Please double check the .htaccess configuration. Any syntax errors will cause a 500 Internal Server Error message to be displayed instead of your website.
To confirm whether a misconfiguration .htaccess is the cause of the 500 Internal Server error, either remove or rename the .htaccess file temporarily and then try to reload the page
PHP Coding Timing Out
if your PHP script makes external network connections, the connections may time out. If too many connections are attempted and time out, this will cause a "500 Internal Server Error." To prevent these time outs and errors, you'll want to make sure that PHP scripts be coded with some timeout rules. Typically, however, catching a timeout error when connecting to a database or externally to remote resources (example: RSS feeds) are difficult. They, in effect, freeze the script from continuing to run.
Removing any external connections can increase both the performance of your website and decrease the chances of you receiving a "500 Internal Server Error."

This problem happen when the connection between client and server disconnected before complete the request.
I Solved this problem by increase the values of FastCGI configurations which located in file "/etc/httpd/conf.d/fcgid.conf" (In Apache 2.4, CentOS 7) to this values:
<IfModule mod_fcgid.c>
FcgidMaxRequestLen 10737418240
FcgidIOTimeout 36000
FcgidConnectTimeout 36000
FcgidBusyTimeout 36000
FcgidIdleTimeout 96000
FcgidProcessLifeTime 96000
</IfModule>

Related

FastCGI: comm with server aborted: read failed

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!
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.

FastCGI server error 500

I have an Ubuntu virtual server where I host my php website with the newest version of Plesk 12 and PHP 5.5. Sometimes (I believe when I open pages quickly one after another), I get an Internal Server error message..
When I refresh the page, the site is normal again immediatly, but sometimes the error message dissappears after about one minute later.
this is what I get on the page:
Internal Server Error 500.
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Error log:
[fcgid:warn] [pid 26583] (104)Connection reset by peer: [client (ip
address)] mod_fcgid: error reading data from FastCGI server, referer:
(url here)
[core:error] [pid 26583] [client (ip address)] End of script output
before headers: index.php, referer: (same url here)
Given your error log it looks like the index page wanted to write an HTTP header (with either header() or set_cookie or similar) AFTER it printed regular output, in your case probably a warning message due to an interrupted connection.
What I would try to do is disable all error output in the page with the php.ini, but still log the errors.
PHP can only output HTTP header fields before any other regular output, warning and error messages on the page included. So if you direct all errors and warnings only to the log files, and NOT print them on the page, there will be no output before the HTTP header and it should work fine.
If any PHP script causes an error, try following this procedure:
Switch from FastCGI to CGI
Trigger an error with another request
Inspect error_log for actual errors, fix them accordingly
Switch back to FastCGI
If configuration files like apache.conf have an error in them it will not appear in the error log with FastCGI on.

Magento 500 errors. First in checkout, now everywhere

I am receiving 500 errors on my Magento webshop.
First the problem occurred only in checkout/onepage and only when logged in (not as guest).
Now every page return a 500 error.
What I have tried:
I have run a magento-cleanup script to reset all file permissions.
I have checked the magento logs, but no errors present themselves.
Clearing cache.
Removing root htaccess.
Apache error
Apache error log gives the following message for all 500's:
[:error] [pid 13758:tid 3006368270080] (104)Connection reset by peer: [client 2a02:1810:1014:a400:2526:ccb1:97d4:72e6:28829] FastCGI: failed to read from backend server
The website itself gives no errors (php) although I have set all the debug options in index.php.
I have contacted my hoster to check the FastCGI message. But I am thinking the problem remains with Magento.
The problem was solved with cooperation from the hoster.
There was a problem with the APC Cache system.
The solution here was to add this to php.ini:
zend.enable_gc = 0

server X brings back 200 response, Server Y throws and Internal server error

I'm having an issue with a CURL reader I built (see: Premature end of script headers: php-cgi -- While running a CURL script)
The guy said to check if my problem server will speak to the feed, so I tested the below code locally and it works, tested in on the server and got an internal server error. I am lost here, how should I go about debug this as the host company are not being very helpful at all.
code:
$url = 'http://www.energydigger.com/feeds/headlines.xml';
list($status) = get_headers($url);
if (strpos($status, '200') !== FALSE) {
echo 'boom';
}
problem server response:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root#localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
all i am getting from the log they provide is:
[Wed Apr 24 20:36:01 2013] [warn] mod_fcgid: read data timeout in 60 seconds
[Wed Apr 24 20:36:01 2013] [error] [client 151.227.255.54] Premature end of script headers: php-cgi
Any advice is appreciated, as I'm a little stuck on what to do now.
Maybe I could reproduce it. But my environment uses mod_fcgid not simple cgi. Make sure the owner and group are the same as for the executing cgi user. Or for simplicity as all the other files in your webdirectory.

Site taking 5 minutes to load homepage - mod_fcgid: ap_pass_brigade failed in handle_request function

The server is running apache2, and when trying to load a webpage it can take up to 5 minutes to load the homepage. All internal pages seems fine however. Checking the Error Logs I see the following:
[warn] (103)Software caused connection abort: mod_fcgid: ap_pass_brigade failed in handle_request function
Can someone please tell me how to fix this?
Not an answer but can you install another webserver? Nginx and lighttpd are good products, open source, 1000x times faster and easier to setup.
if you use mod_fcgid try change MaxRequestsPerProcess for more request

Categories