mac nginx+ci ,lumen等网页开发环境配置

mac下搭建 lumen ci环境

mac基本配置,如php、redis、mysql、vim、chrome等软件安装这里不详细说明。

 

 

1、设置/ete/hosts:

把要访问的域名绑定到本地的端口

这样能保证我们登陆域名的时候,可以重定向到本地。

127.0.0.1       mobile.ymt360.com

127.0.0.1       my-uc-test.ymt360.com

127.0.0.1       localhost

255.255.255.255 broadcasthost

::1             localhost

~                         

 

2、nginx配置。

  安装nginx不细讲,mac  可用brew install 主要讲配置(域名引用到对应的文件目录)

   1、先在nginx.conf 里面配置一个include servers/*

   2、在servers里面自己新建一个*.conf ,如mobile.conf

配置server

server {

    listen 80;

    server_name mobile.ymt360.com;

    index index.php;

    root /data/www/website/mobile/public;

    access_log  /data/nginxlogs/mobile.ymt360.com.log;

    error_log /data/nginxlogs/mobile.ymt360.com.error;

    client_max_body_size 12m;

    error_page 502 /502.html;

 

    location / {

        index index.php;

        if (!-e $request_filename) {

            rewrite ^/(.+)$ /index.php/$1 last;

        }

    }

 

    location ~ ^/index\.php {

        set $path_info “”;

        set $real_script_name $fastcgi_script_name;

        if ($fastcgi_script_name ~ “^(.+?\.php)(/.+)$”) {

            set $real_script_name $1;

            set $path_info $2;

        }

        charset utf-8;

        fastcgi_param PATH_INFO $path_info;

        include fastcgi.conf;

    }

 

    location ~ .*\.php$ {

        deny all;

    }

}

 

 

3.  php-fastcgi配置

    主要配置 fastcgi.conf

     find / -name 找到 fastcgi.conf  在里面找到fastcgi_path把通信端口改成127.0.0.1:9000

    这里路径用9000端口

 4.php-pfm.conf 配置,可参考原环境自行配置。如uc-test。

PS

   如果出现直接把index.php页面下载下来了,那么就在nginx.conf里面include fastcgi.conf里面包含了fastcpg路径。

    

 

原文链接:https://www.cnblogs.com/zhezhong/p/5590443.html
本文来源 爱码网,其版权均为 原网址 所有 与本站无关,文章内容系作者个人观点,不代表 本站 对观点赞同或支持。如需转载,请注明文章来源。

© 版权声明

相关文章