Nginx+FastCGI 环境搭建 Kohana

Cool~
迟交的作业哈...
我给你复制黏贴过来.

server {
	listen   kohana.local:8080;
	server_name  kohana.local;
	access_log  /var/log/nginx/kohana.access.log;
 
	# define server root path
	set $root_path /home/icyleaf/php/kohana;
 
	location / {
		root   $root_path;
		index  index.php index.html index.htm;
 
		if (!-e $request_filename) {
		    rewrite ^/(.*)$ /index.php?kohana_uri=/$1 last;
		}
	}
 
	# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
	#
	location ~ \.php$ {
		root   $root_path;
		fastcgi_pass   127.0.0.1:9000;
		fastcgi_index  index.php;
		fastcgi_param  SCRIPT_FILENAME  $root_path$fastcgi_script_name;
		include fastcgi_params;
	}
}

可以单独安装spawn-fcgi

KO3里,没有kohana_uri这个东东了吧

在 FastCGI 模式下必须指定一个 URI 变量才可以使得 clean uri 正常解析,所以 kohana_uri 只是一个随意定义的 key

呃,昨天翻译官方文档发现也提供了解决方案:http://v3.kohana.cn/guide/tutorials.removeindex

发表讨论

在回复之前你需要先进行登录
记住我的登录状态 (忘记密码)