導航:首頁 > 編程語言 > 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相關的資料

熱點內容
男的送快遞,女的在按摩的上班的叫什麼電影 瀏覽:751
海綿寶寶大電影免費中文版 瀏覽:275
愛國戰爭片免費觀看 瀏覽:887
三位數碼管單片機是如何工作的 瀏覽:728
免費看不下載老電影院 瀏覽:511
啄木鳥影業都有哪些作品 瀏覽:824
在電腦上怎麼把pdf保存成圖片 瀏覽:767
末段愛情廣播劇是哪個app可以聽 瀏覽:322
e片免費看 瀏覽:361
成龍教外國小孩功夫電影叫什麼 瀏覽:482
disk命令分區 瀏覽:912
丁巴度愛與激情 瀏覽:264
韓國野戰電影 瀏覽:462
法國chouchou在線觀看 瀏覽:700
linux歷史命令查看 瀏覽:964
堅果安卓11怎麼樣 瀏覽:497
imovie壓縮 瀏覽:453
古裝鬼電影大全 瀏覽:457
韓電影app 瀏覽:888
何炅參加密室逃脫視頻 瀏覽:897