티스토리 뷰

Make sure php support fastcgi

Type any one of the following command to verify that php support fastcgi
$ php -v

Output:

PHP 5.0.4 (cli) (built: Nov  8 2005 08:27:12)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies

OR
$ php-cgi -v
Output:

PHP 5.0.4 (cgi-fcgi) (built: Nov  8 2005 08:25:54)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies

You must get string cgi-fcgi. Next find out full path to php-cgi or php binary:
$ which php-cgi
Output:

/usr/bin/php-cgi

Open lighttpd configuration file:
# vi /etc/lighttpd/lighttpd.conf

First add the module mod_fastcgi (lighttpd provides an interface to a external programs that support the FastCGI interface via this module). Make sure your server.modules loades mod_fastcgi:

server.modules              = (
            "mod_access",
            "mod_accesslog",
            "mod_fastcgi",
            "mod_rewrite",
            "mod_auth"
)

Now add following lines to configuration:

fastcgi.server = ( ".php" => ((
                     "bin-path" => "/usr/bin/php-cgi",
                     "socket" => "/tmp/php.socket"
                 )))

Save the configuration and close all the files. Restart the lighttpd:
# /etc/init.d/lighttpd restart

Test your configuration by running php program or application.

'기억하자정보 > 기타' 카테고리의 다른 글

MBR 과 GPT 비교 설명  (0) 2013.07.27
리눅스/fstab 부팅시 자동 마운트  (0) 2013.07.20
lighttpd fastcgi 설정 방법  (0) 2012.11.29
윈도우 8 (Windows 8) 단축키  (0) 2012.10.31
nohup 사용 방법  (0) 2012.10.30
댓글
안내
궁금한 점을 댓글로 남겨주시면 답변해 드립니다.