You are here: php+fastcgi on Apache « PHP Programming Language « IT news, forums, messages
php+fastcgi on Apache

Posted by drblitzkrieg on 01/19/08 04:19

Hello,

I'm trying to get FastCGI to run normal php scripts from mod_fastcgi.
The documentation seems outdated. So far I have done the following:

-------downloaded and re-installed php, with:
../configure --enable-fastcgi (no errors)
make
make install
cp sapi/cgi/php-cgi /usr/local/apache2/htdocs/fcgi/


---------put this in httpd.conf (as you can see I've tried a few other
approaches too):
LoadModule fastcgi_module modules/mod_fastcgi.so
<IfModule mod_fastcgi.c>
#AddType application/x-httpd-fastphp .fphp

# Dynamic Settings
<Directory /usr/local/apache2/htdocs/fcgi>
Options +ExecCGI
SetHandler fastcgi-script
</Directory>

#AddHandler fastcgi-script fcgi fphp

# Static Settings
FastCgiServer /usr/local/apache2/htdocs/fcgi/php-fcgi
# FastCgiConfig -singleThreshold 1

Action fastcgi-script /fcgi/php-fcgi
Action x-httpd-fastphp /fcgi/php-fcgi
</IfModule>

(also tried with and without the mod_php being loaded).
---------------------------------

Currently, the server will run regular fastcgi apps (say, written in C
using the FCGX_Accept loop) that are in /fcgi correctly, but not
regular php scripts. logs/error_log gives this repeatedly:

[warn] FastCGI: (dynamic) server "/usr/local/apache2/htdocs/fcgi/
test.php" has failed to remain running for 30 seconds given 3
attempts, its restart interval has been backed off to 600 seconds

So it appears it's still running php scripts with the normal mod_php,
or else the newly-compiled php isn't working (When I just run fcgi/
php-
fcgi somescript.php, it spews out the contents just like regular;
isn't it supposed to fork and await input from the server?).

Running strace on httpd does not show it opening the php-cgi binary
when I request a php page; is there a way to debug what it's doing vs.
should be doing when loading that config? Docs are sparse, help
appreciated.

------System --- info:
# uname -a
Linux myserver 2.6.22-14-server #1 SMP Sun Oct 14 22:09:15 GMT 2007
x86_64 GNU/Linux

(It's ubuntu, but all of the below I downloaded and compiled from
source:)

# apachectl -v
Server version: Apache/2.2.6 (Unix)
Server built: Jan 11 2008 16:08:58

# /usr/local/apache2/htdocs/fcgi/php-cgi -v
PHP 5.2.5 (cgi-fcgi) (built: Jan 18 2008 16:15:38)

fastcgi: 2.4.0

Thanks

--
Blitzen

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация