导航:首页 > 编程语言 > thinkphp5php54

thinkphp5php54

发布时间:2024-02-26 15:39:04

1. Thinkphp5项目在nginx服务器部署

1,切换到nginx的配置目录,找到nginx.conf文件

    cd   /usr/local/nginx/conf

    vim  nginx.conf

2,如果是单项目部署的话,只需要在nginx.conf文件里面加上以下

server{

        listen 80;

        # 域名,本地测试可以使用127.0.0.1或localhost

        server_name www.zhangc.cn;

        # php项目根目录

        root /home/data-www/blog;

        location /{

                # 定义首页索引文件的名称

                index index.php index.html index.htm;

                # 影藏入口文件

                if (-f $request_filename/index.html){

                            rewrite (.*) $1/index.html break;

                }

                if (-f $request_filename/index.php){

                            rewrite (.*) $1/index.php;

                }

                if (!-f $request_filename){

                            rewrite (.*) /index.php;

                }

                try_files $uri $uri/ /index.php?$query_string;

        }

        # PHP 脚本请求全部转发到 FastCGI处理. 使用FastCGI协议默认配置.

        # Fastcgi服务器和程序(PHP)沟通的协议

        .location ~ .*\.php${

                # 设置监听端口

                fastcgi_pass 127.0.0.1:9000;

                # 设置nginx的默认首页文件

                fastcgi_index index.php;

                # 设置脚本文件请求的路径

                fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name;

                # 引入fastcgi的配置文件

                include fastcgi_params;

                fastcgi_split_path_info ^(.+?\.php)(/.*)$;

                set $path_info $fastcgi_path_info;

                fastcgi_param PATH_INFO $path_info;

                try_files $fastcgi_script_name =404;

        }

}

3,如果多项目部署,就需要配置vhost

第一步:编辑nginx.conf文件,在最后加上     include    vhost/*.conf;

第二步:进入vhost文件夹,创建    域名.conf    文件,如创建一个:quanma.meyat.com.conf

第三步:编辑quanma.meyat.com.conf文件,内容如下:

        server

        {

                listen 80;

                server_name quanma.meyat.com;

                index index.html index.htm index.php default.html default.htm default.php;

                root /data/wwwroot/default/quanma/public/;

                #error_page 404 /404.html;

                location / {

                        index index.html index.php;

                        if (-f $request_filename/index.html){

                                rewrite (.*) $1/index.html break;

                        }

                        if (-f $request_filename/index.php){

                                rewrite (.*) $1/index.php;

                        }

                        if (!-f $request_filename){

                                rewrite (.*) /index.php;

                        }

                        try_files $uri $uri/ /index.php?$query_string;

                }

                location ~ [^/]\.php(/|$)

                {

                        # comment try_files $uri =404; to enable pathinfo

                        #try_files $uri =404;

                        fastcgi_pass 127.0.0.1:9000;

                        fastcgi_index index.php;

                        include fastcgi_params;

                        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

                        fastcgi_split_path_info ^(.+?\.php)(/.*)$;

                        set $path_info $fastcgi_path_info;

                        fastcgi_param PATH_INFO $path_info;

                        try_files $fastcgi_script_name =404;

                        #include fastcgi.conf;

                        #include pathinfo.conf;

            }

            location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

            {

                    expires 30d;

            }

            location ~ .*\.(js|css)?$

            {

                    expires 12h;

            }

            # Disallow access to .ht, .svn, .bzr, .git, .hg, .cvs directories

            location ~ /\.(ht|svn|bzr|git|hg|cvs) {

                    deny all;

            }

            #access_log /date/nginx/bmp.com.conf/access.log main;

}

2. “thinkphp5.0”的安装步骤是什么

thinkphp框架是目前国内比较流行的PHP框架之一,不管是初学者还是老学员都能容易上手,快速,安全开发网站。具体安装步骤如下:

3. thinkphp5支持php什么版本

php的5.6以上都支持

阅读全文

与thinkphp5php54相关的资料

热点内容
幼儿编程教育培训多少钱 浏览:401
经常生气有什么东西能解压 浏览:900
代理服务器地址和端口可以怎么填 浏览:62
unity5手游编译模型 浏览:265
安卓无人机app源码 浏览:808
pl1编程语言 浏览:801
台达plc编程换算指令大全 浏览:174
手机上的编程游戏 浏览:108
服务器密码机有什么用 浏览:477
dos磁盘命令 浏览:955
单片机cpu52的功能 浏览:691
opc服务器怎么开发 浏览:373
觅喜是个什么app 浏览:402
加密cd机 浏览:946
社保用什么app缴纳 浏览:313
nodevlinux 浏览:582
腾讯tt服务器怎么登录密码 浏览:898
windows命令提示符 浏览:352
win7管理员权限命令 浏览:729
地图app哪个适合老年人用 浏览:74