<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                > lnmp1.5集成環境下部署thinkphp5.0框架的項目,無法正常訪問,訪問報404頁面等。 ![](https://box.kancloud.cn/f158d4e4bc8ee400d101bdebad68baac_671x244.png) 首先tp5的訪問目錄指向到webroot/public文件夾中。thinkphp的url訪問:http:// serverName/ index.php(或者其它應用入口文件)/模塊/控制器/操作/\[參數名/參數值...\],這個需要支持pathinfo,Apache默認支持,而Nginx不支持。 ### **修改站點配置文件** > 使用 lnmp1.5一鍵安裝包 添加虛擬機主機會自動生成配置文件 > lnmp1.5的站點配置文件一般在 /usr/local/ngnix/conf/vhost/站點.conf 將項目路徑指向public目錄,設置PATH_INFO,去掉入口文件,如下 ``` server { listen 80; #listen [::]:80; server_name www.thbuyshop.com thbuyshop.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/www.thbuyshop.com/public; include rewrite/other.conf; #error_page 404 /404.html; # Deny access to PHP files in specific directory #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } include enable-php-pathinfo.conf; #======================================= # 添加內容部分 #定義變量 set $root /home/wwwroot/www.thbuyshop.com/public; location ~ [^/]\.php(/|$) { try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; #設置PATH_INFO fastcgi_split_path_info ^((?U).+.php)(/?.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name; #引入fastcgi配置 include fastcgi.conf; } #從URL中去掉index.php入口文件 location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } #添加內容結束 #=================================== location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /.well-known { allow all; } location ~ /\. { deny all; } access_log /home/wwwlogs/www.thbuyshop.com.log; } ``` ### **修改 fastcgi.conf 中的配置文件** ``` # 進入 fastcgi.conf 文件目錄 cd /usr/local/nginx/conf # 修改 fastcgi.conf 配置文件 vim fastcgi.conf # 開放目錄訪問權限(因為根目錄設置到public下導致框架訪問上級目錄權限不夠) fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/wwwroot/:/tmp/:/proc/"; ``` ### **修改 php.ini 中的配置文件** 如果以上設置仍未生效,再進行此操作。 ``` # 進入 php.ini 文件目錄 cd /usr/local/php/etc # 修改 php.ini 配置文件 vim php.ini # 修改內容 cgi.fix_pathinfo = 1 ``` ***** 至此,thinkphp5項目路徑訪問已經正常,如果網頁出現 failed to open stream: No such file or directory in的問題,則可能是項目權限不足。 進入站點根目錄 -> 執行:chown -R www:www * 即可。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看