Showing posts with label fastCGI. Show all posts
Showing posts with label fastCGI. Show all posts

Wednesday, April 23, 2008

lighttpd php fastcgi and 500 internal error

当访问php页面时,得到一个500服务器内部错误(500 internal error ),服务器端错误日志如下:


2008-04-23 23:20:50: (mod_fastcgi.c.1743) connect failed: Connection refused on unix:/tmp/php-fastcgi.socket-3
2008-04-23 23:20:50: (mod_fastcgi.c.2912) backend died; we'll disable it for 5 seconds and send the request to another backend instead: reconnects: 0 load: 1
2008-04-23 23:20:50: (mod_fastcgi.c.2471) unexpected end-of-file (perhaps the fastcgi process died): pid: 350 socket: unix:/tmp/php-fastcgi.socket-3
2008-04-23 23:20:50: (mod_fastcgi.c.3281) response not received, request sent: 872 on socket: unix:/tmp/php-fastcgi.socket-3 for /php/phpinfo.php , closing connection

用lighttpd fastcgi模式调用php时报以上错误,在lighttpd官方网站上查到,是因为php在编译时未指定--enable-fastcgi, 于是重新编译了最新版的php5.2.5:

./configure --prefix=/usr/local/php5 --with-zlib --enable-fastcgi --with-mysql=/usr/local/mysql --enable-mbstring --enable-sockets --enable-gd-native-ttf --with-snmp --enable-soap
make
sudo make install

重启lighttpd之后即可正确访问php文件。

Monday, April 21, 2008

install fastcgi and ruby-fastcgi

curl -O http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar xzvf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure --prefix=/usr/local/fcgi240
make
sudo make install
cd ..

# install Ruby-FastCGI gem

curl -O http://rubyforge.iasi.roedu.net/files/fcgi/ruby-fcgi-0.8.7.tar.gz
tar xzvf ruby-fcgi-0.8.7.tar.gz
cd ruby-fcgi-0.8.7
/usr/local/bin/ruby install.rb config -- --with-fcgi-dir=/usr/local/fcgi240
/usr/local/bin/ruby install.rb setup
sudo /usr/local/bin/ruby install.rb install
cd ..

# or install Ruby-FastCGI gem using:
$> sudo gem install fcgi -- --with-fcgi-dir=/usr/local/fcgi240

# Building native extensions. This could take a while...
# Successfully installed fcgi-0.8.7
# 1 gem installed