博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
thinkphp ,laravel,yii2运行环境搭建.
阅读量:6167 次
发布时间:2019-06-21

本文共 4177 字,大约阅读时间需要 13 分钟。

Nginx 

YII

server {        charset utf-8;        client_max_body_size 128M;        listen 80;        server_name 2bphp.com;        root  /data/www/yii2/web;        index  index.php;            location ~* \.(eot|otf|ttf|woff)$ {            add_header Access-Control-Allow-Origin *;        }            location / {            try_files $uri $uri/ /index.php?$args;        }            location ~ \.php$ {            include   fastcgi_params;        fastcgi_index    index.php;        fastcgi_param    SCRIPT_FILENAME    $document_root$fastcgi_script_name;            fastcgi_pass   127.0.0.1:9000;            try_files $uri =404;        }    }
server {        charset utf-8;        client_max_body_size 128M;        listen 80;        server_name laravel.local.test;        root  /data/www/laravel/public;        index  index.php;            location ~* \.(eot|otf|ttf|woff)$ {            add_header Access-Control-Allow-Origin *;        }            location / {            try_files $uri $uri/ /index.php?$args;        }            location ~ \.php$ {            include   fastcgi_params;        fastcgi_index    index.php;        fastcgi_param    SCRIPT_FILENAME    $document_root$fastcgi_script_name;            fastcgi_pass   127.0.0.1:9000;            try_files $uri =404;        }    }

  

server {        charset utf-8;        client_max_body_size 128M;        listen 80;        server_name tp5.local.test;        root  /data/www/tp5/public;        index  index.php;            location ~* \.(eot|otf|ttf|woff)$ {            add_header Access-Control-Allow-Origin *;        }            location / {            index    index.html index.php;            if ( -f $request_filename) {                break;            }                if ( !-e $request_filename) {                rewrite ^/(.*)$ /index.php/$1 last;                break;            }        }            location ~ \.php {            set $script $uri;            set $path_info "";            if ($uri ~ "^(.+\.php)(/.+)") {                set $script $1;                set $path_info $2;            }        include   fastcgi_params;        fastcgi_index    index.php?IF_REWRITE=1;        fastcgi_pass   127.0.0.1:9000;        fastcgi_param    PATH_INFO    $path_info;        fastcgi_param    SCRIPT_FILENAME    $document_root$fastcgi_script_name;        fastcgi_param    SCRIPT_NAME    $script;        try_files $uri =404;        }    }

Apache 

ServerName yii.local.test DocumentRoot /data/www/yii2/web
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php

.htaccess 代码如下

RewriteEngine on    # If a directory or a file exists, use it directly    RewriteCond %{REQUEST_FILENAME} !-f    RewriteCond %{REQUEST_FILENAME} !-d    # Otherwise forward it to index.php    RewriteRule . index.php

  

ServerName laravel.local.test DocumentRoot /data/www/laravel/public
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php

.htaccess 代码如下

Options -MultiViews
RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L]

  

ServerName tp5.local.test DocumentRoot /data/www/tp5/public/

 .htaccess 代码如下

Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

 本文来源网站 

转载于:https://www.cnblogs.com/aln0825/p/8998565.html

你可能感兴趣的文章
指针的看法
查看>>
Cocos-2d 坐标系及其坐标转换
查看>>
LAMP网站的CACHE机制概要
查看>>
[MySQL 5.6] 5.6新参数slave_rows_search_algorithms
查看>>
ESXi5.1嵌套KVM虚拟化环境支持配置
查看>>
爬虫的小技巧之–如何寻找爬虫入口
查看>>
JVM学习(二)垃圾收集器
查看>>
为hexo博客添加基于gitment评论功能
查看>>
java 库存 进销存 商户 多用户管理系统 SSM springmvc 项目源码
查看>>
Flutter - Drawer 抽屉视图与自定义header
查看>>
ERP系统的优势_库存管理软件开发
查看>>
如何内行地评价公链(一)从真正的不可能三角谈起
查看>>
BigDecimal 详解
查看>>
Shell实战之函数的高级用法
查看>>
NASA制做模拟系外行星环境 发现了热木星大气不透明的原因
查看>>
Slog67_后端框架Skynet之Makefile解读
查看>>
iOS ShareSDK桥接技术
查看>>
BAT面试须知:Java开发的招聘标准
查看>>
WeUI for 小程序–使用教程
查看>>
[vuex] unknown action type
查看>>