×

nginx phpinfo

ThinkPHP在nginx上运行,配置phpinfo

我的笔记 我的笔记 发表于2018-11-20 18:47:37 浏览4202 评论0

抢沙发发表评论

问题:thinkPHP在nginx中运行

因为我想把thinkPHP运行在k3上。而k3路由器装的是onmp,所以就需要配置nginx:

在我的配置文件中做以下修改,使其支持phpinfo(otherconf以下)

server {
    listen 91;
    server_name localhost;
    root /opt/wwwroot/Zblog/;
    index index.html index.htm index.php tz.php;
    include /opt/etc/nginx/conf/php-fpm.conf;
        #otherconf
	location / {
		root      /opt/wwwroot/Zblog;
		index index.html index.php;
		if (!-e $request_filename){
		  rewrite ^(.*)$ /index.php?s=$1 last;
		}
	 }
	location ~ \.php$ {
		root      /opt/wwwroot/Zblog;
		fastcgi_pass  127.0.0.1:9000;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		include    fastcgi_params;
	}
}


我的笔记博客版权我的笔记博客版权