Fast CGI + Custom PHP
Posted by: Tenstones
Posted on: 2008-10-16 17:26:00
I have had a custom install of php 5.2.6 running for a while now, but it just feels slow so I wanted to see if fast cgi would speed it up and I can't get it working for the life of me.
I followed the information in the wiki ( http://wiki.dreamhost.com/PHP_FastCGI )
My wrapper is named dispatch.fcgi and contains:
#!/bin/sh
export PHPRC=/home/tenstone/tenstones.net/cgi-bin
export PHP_FCGI_CHILDREN=3
exec /home/tenstone/tenstones.net/cgi-bin/php.cgi
My .htaccess is:
Options +ExecCGI
#Action php-cgi /cgi-bin/php.cgi
#AddHandler php-cgi .php
AddHandler fastcgi-script fcg fcgi fpl
AddHandler php-fastcgi .php
Action php-fastcgi /cgi-bin/dispatch.fcgi
<FilesMatch "^php5?\.(ini|cgi)$">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]
RewriteRule . - [L]
</IfModule>
ErrorDocument 404 /forums/404.php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !forums/
RewriteCond %{QUERY_STRING} !vbseourl=
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ forums/vbseo.php?vbseourl=$1&vbseorelpath=../&%{QUERY_STRING} [L]
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|redir\.php|vbseo_sitemap|autotagger_ajax\.php|404\.php)
RewriteCond %{REQUEST_FILENAME} !forums/
#RewriteRule ^(.*\.php)$ forums/vbseo.php?vbseourl=$1&vbseorelpath=../&%{QUERY_STRING} [L]
Like the wiki page says I get no response when I update the .htaccess and the error.log says:
[Thu Oct 16 16:20:47 2008] [error] [client 74.6.22.88] FastCGI: comm with (dynamic) server "/mnt/local/home/tenstone/tenstones.net/cgi-bin/dispatch.fcgi" aborted: (first read) idle timeout (60 sec)
[Thu Oct 16 16:20:47 2008] [error] [client 74.6.22.88] FastCGI: incomplete headers (0 bytes) received from server "/mnt/local/home/tenstone/tenstones.net/cgi-bin/dispatch.fcgi"
I tried touch dispatch.fcgi like it says and still nothing shows up when I do a ps.
How my main domain is stuck with a 503 error while the subdomains work and the error.log is spammed with:
[Thu Oct 16 17:18:51 2008] [error] [client 76.236.96.241] access to /info.php failed for 76.236.96.241, reason: Client exceeded concurrent connection limit of 20
Changing back the .htaccess has no effect.
Tenstones Gaming Community