can't apply process slot - php

I've got a problem with a webserver. I did change nothing on the Apache config, I was just working on the site (typo3 FYI) when I got these 500 Error codes. Other websites are running fine. Could it be that it was a one-time error and apache then decided "I dont like you anymore"?
[Tue May 03 15:44:47 2011] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Tue May 03 16:00:02 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/typo3/ajax.php
[Tue May 03 16:00:08 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
[Tue May 03 16:00:38 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
[Tue May 03 16:00:42 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
[Tue May 03 16:01:00 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
and so on...
my fcgid.conf
<IfModule mod_fcgid.c>
MaxProcessCount 100
AddHandler fcgid-script .fcgi
IPCConnectTimeout 20
</IfModule>
would restart the (production-)server solve the problem?

According to this page:
The fix is simple. In my case it was a
simple chmod 755 /var/log/httpd, which
allows Apache to actually read its log
directory! Before the change, I was
getting “Service Unavailable” with a
log error of [warn] mod_fcgid: can’t
apply process slot for [dispatch.fcgi
full path]. Now it works!

Yes,
But It appears the maxProcessCount rule is not honored found here
http://www.apachelounge.com/viewtopic.php?t=2563
If you read that you see you can set a variable to ensure it does

Related

How to solve issue with FastCGI: "Error reading data from FastCGI server"

My application contains some heavy processes (heavy db queries like
insert/update/delete queries by doctrine) and in some cases I get the following errors on the MySQL NGINX + PHP 7.4:
[Fri Apr 15 03:14:11.199479 2022] [fcgid:warn] [pid 2237536:tid 139805102909184] (104)Connection reset by peer: [clientx:50558] mod_fcgid: error reading data from FastCGI server
[Fri Apr 15 03:14:11.199523 2022] [core:error] [pid 2237536:tid 139805102909184] [client x:50558] End of script output before headers: index.php
The issue disappeared for a few days when I adjusted following variables:
FcgidBusyTimeout 1800
FcgidIOTimeout 1800
I adjusted also configuration for PHP (memory limit and max_execution_time).
I can see that problem occurs again (I think the process has more queries to perform). What else should I change for the FastCGI config to fix this issue?
Thank you in advance.

php does not work always returns 500 error

I host 3 web site on an vps.
each has a phpt test script
a1.com/test.php
a2.com/test.php
a3.com/test.php
a1.com/test.php
a2.com/test.php
work well
but when I call
a3.com/test.php
it always report error
[Wed Jan 28 01:01:52.801563 2015]
[fcgid:warn] [pid 27783] (104)Connection reset by peer:
[client ***.***.27.***:50211]
mod_fcgid: error reading data from FastCGI server
[Wed Jan 28 01:01:52.801651 2015] [core:error] [pid 27783]
[client ***.***.27.***:50211]
End of script output before headers: test.php
your comment welcome
Speaking on personal experience, make sure that the directory/file permissions are set properly on a3.com/test.php. If not set properly they can result in a 500 error

FastCGI Segmentation Fault on PHP 5.5.8

I'm using Debian 7 Wheezy with latest updates installed, including those from dotdeb-PHP repo. So PHP 5.5.8 is present.
I've installed eqDKP-plus (eqdkp-plus.eu) on my webserver. PHP is embedded through mod_fcgid in Apache.
Since 2 days everytime I visit any site of eqdkp I get response Code 500.
Following log-entries:
[Mon Jan 13 17:03:43 2014] [warn] [client xxxxxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Mon Jan 13 17:03:43 2014] [error] [client xxxxxx] Premature end of script headers: viewnews.php
[Mon Jan 13 17:07:46 2014] [error] mod_fcgid: process /var/www/cgi-bin/cgi_wrapper/cgi_wrapper(16094) exit(communication error), get signal 11, possible coredump generated
Do you guys have any ideas on how solve this problem? In the last few days/weeks I didn't change anything on my server, so this makes no sense to me.

Setting up PHP for Apache on Windows

I have been trying to set up PHP from php.net in my Apache web server (localhost).
Over the last day and a half I've been chasing through documentation at the Apache site, the php.net site, SO, and anywhere else shows a hit for the current error, to try and solve the problems. Here are some details of my current set-up and (possible mis)understanding.
Define SRVROOT "/Apache/00"
ServerRoot "${SRVROOT}"
The public directory of Apache is set to htdocs. Apache is producing listings of the directories under it without any problems through localhost. Just to make bleeding sure that I have the right address and it it is Apache, I do an on/off test as described below.
I ran the Windows MSI supplied for PHP. Then I adjusted the /conf/httpd.conf file to add:
ScriptAlias /php/ "${SRVROOT}/php/"
AddType application/x-httpd-php .php
Note: php, htdocs (public files) & conf directories are all in the root of the same directory, SRVROOT.
Test Apache
http://localhost/lib/
might produce:
Index of /lib
Parent Directory
amd64/
web.jar
x86/
While shutting down Apache and refreshing the listing I see a FF error.
Unable to connect
Firefox can't establish a connection to the server at localhost.
So Apache itself seems to be working fine, when it is running I can do directory listings.
Test PHP
http://localhost/php/
Shows:
Forbidden
You don't have permission to access /php/ on this server.
OK that seems logical, Apache now acknowledges the existence of the directory but says it is not intended to by publicly browsed.
I have an phpinfo.php in the root of the php directory containing.
<?phpinfo();?>
I expect that if I browse to http://localhost/phpinfo.php is should give me information, but instead I get 404 message:
Not Found
The requested URL /phpinfo.php was not found on this server.
For http://localhost/php/phpinfo.php I get forbidden message:
Forbidden
You don't have permission to access /php/phpinfo.php on this server.
Typical error.log
sl:warn] [pid 1504:tid 336] AH01909: RSA certificate configured for localhost:443 does NOT include an ID which matches the server name
[Sun Aug 04 19:06:01.995343 2013] [ssl:warn] [pid 1504:tid 336] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Aug 04 19:06:02.298078 2013] [ssl:warn] [pid 1504:tid 336] AH01909: RSA certificate configured for localhost:443 does NOT include an ID which matches the server name
[Sun Aug 04 19:06:02.298078 2013] [ssl:warn] [pid 1504:tid 336] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Aug 04 19:06:02.300031 2013] [mpm_winnt:notice] [pid 1504:tid 336] AH00354: Child: Starting 64 worker threads.
[Sun Aug 04 19:06:03.279523 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50589] AH01630: client denied by server configuration: I:/Apache/00/php/index.html
[Sun Aug 04 19:15:39.932843 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50599] AH01630: client denied by server configuration: I:/Apache/00/php/
[Sun Aug 04 19:21:49.700421 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50608] AH01630: client denied by server configuration: I:/Apache/00/php/phpinfo.php
[Sun Aug 04 19:26:58.432843 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50621] AH01630: client denied by server configuration: I:/Apache/00/php/phpinfo.php
[Sun Aug 04 19:37:26.403546 2013] [mpm_winnt:notice] [pid 4400:tid 324] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 04 19:37:28.403546 2013] [mpm_winnt:notice] [pid 1504:tid 336] AH00364: Child: All worker threads have exited.
[Sun Aug 04 19:37:28.418195 2013] [mpm_winnt:notice] [pid 4400:tid 324] AH00430: Parent: Child process 1504 exited successfully.
Question
I want to show the phpinfo.php document. Can anyone see the dumb mistake I am making (I am a newbie at this)?
See also:
These are the primary docs I've been looking at:
http://httpd.apache.org/docs/2.4/
http://www.php.net/docs.php
You're probably getting the permission error because the phpinfo.php file does not have permissions set such that the Apache server you're running can read it. Apache can be configured to drop privileges to a limited user account when it runs, and if your file security permissions for a file don't allow that user account to read the file, you will get permission errors. Remember that this applies to every directory in the final path name, i.e. /Apache and /Apache/00 and /Apache/00/php and /Apache/00/php/phpinfo.php must ALL be readable by the user account that Apache runs under.
Another possibility is that you may need to add a Directory directive in httpd.conf to allow access to /php/ if your httpd.conf has a Directory directive for a default access policy of deny-first.
I also don't see any mention of where you've installed the PHP Apache module DLL into the Apache modules folder, nor where you've added the module in your httpd.conf file. If you don't load the PHP module, PHP files will not pass through PHP.

FastCGI Configuration errors - upload and image processing fail

My wordpress is behaving strangely, after I changed the php handler to fcgi
[Sat Dec 03 02:13:06 2011] [warn] [client 66.249.72.226] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sat Dec 03 02:13:06 2011] [error] [client 66.249.72.226] Premature end of script headers: index.php
[Sat Dec 03 02:18:11 2011] [warn] [client 94.139.59.97] mod_fcgid: read data timeout in 40 seconds, referer: http://www.domain.com/wp-admin/upload.php
[Sat Dec 03 02:18:11 2011] [error] [client 94.139.59.97] Premature end of script headers: admin.php, referer: http://www.domain.com/wp-admin/upload.php
[Sat Dec 03 02:18:18 2011] [warn] mod_fcgid: process 24965 graceful kill fail, sending SIGKILL
How can i Fix this? I made the php-handler change via cPanel, along with a php upgrade to 5.3.8.
You need to play with your FCGI settings in order to fix this. This usually speaks of the fcgi scripts dying too fast.
Check out http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html for more information. For a start you could use:
FcgidMinProcessesPerClass 0
FcgidMaxProcessesPerClass 8
FcgidMaxProcesses 150
FcgidIdleTimeout 60
FcgidProcessLifeTime 120
FcgidIdleScanInterval 30

Categories