首页 > 其他 > 详细

docker 搭建lnmp开发环境

时间:2020-08-24 15:31:48      阅读:79      评论:0      收藏:0      [点我收藏+]

初衷:平时开发的时候想让项目代码运行linux环境,避免一些在windows环境正常,linux有问题的情况,比如字符编码,小数那些;

一,为了方便在windows下写代码,用Samba来实现linux的项目代码目录映射到windows,度娘一下根据他们的流程就可以搞出来,很简单的流程;

       其中可能碰到的问题就是,映射到windows后,点击提示无权限,解决方案: 赋予项目目录  chmod -R 777  权限,如果还是不行, 比如 root 目录下,在最外层赋予权限  chmod -R 777 /root 

 

二,docker 搭建 LNMP, 可看下面 github 一个写好的按步骤操作,亲测有效;

      https://github.com/duiying/Docker-LNMP

      

     附上TP5.0设置的conf文件:

server {
        listen       80;
        server_name  xxx.com;
        root /data/www/项目目录名称/public;
    location / {  
        index index.html index.htm index.php admin.php; 
        if (!-e $request_filename) {
    rewrite ^/index.php(.*)$ /index.php?s=$1 last;
     rewrite ^(.*)$ /index.php?s=$1 last;
     break;
        }  
    }

        location ~ \.php(.*)$ {
            fastcgi_pass cgi:9000;
        try_files $uri =404;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

以上,仅记录一下未接触过docker,想搞下docker的历程。(没接触过的推荐看菜鸟教程了解一下)

docker 搭建lnmp开发环境

原文:https://www.cnblogs.com/pyspang/p/13554016.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!