参考
環境
- 256MB版 Raspberry Pi (raspbian)
- nginxは【raspberry-pi】nginx + passenger + node.js 環境作成メモ (1)で導入したもの
php5-cgiパッケージをインストール
$ sudo aptitude install -y php5-cgi
$ /usr/bin/php-cgi -v
PHP 5.4.4-14+deb7u7 (cgi-fcgi) (built: Dec 13 2013 02:09:22)
起動スクリプト
-
冒頭の参考サイトのものを多少編集して使用する。
-
自動起動
$ sudo update-rc.d php-fastcgi default
$ sudo sysv-rc-conf --list | grep php
php-fastcgi 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nginx設定
/opt/nginx/conf/nginx.conf
server {
# 省略...
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $uri;
}
location ~ ^/dokuwiki/(data|conf|bin|inc)/ {
deny all;
}
location ~ ^/dikuwiki/lib/^((?!php).)*$ {
root html/dokuwiki/lib;
expires 30d;
}
}