centos 支援ThinkPHP的pathinfo 配置

來源:互聯網
上載者:User

標籤:blog   http   os   io   ar   檔案   art   div   log   

找到nginx下面的nginx.conf檔案

一般都是在

#vim /usr/local/nginx/conf/nginx.conf

  

 

找到此處 如果存在pathinfo.conf 則將include pathinfo.conf; 前面的#刪除 如果沒有則添加

 location ~ [^/]\.php(/|$) {                                # comment try_files $uri =404; to enable pathinfo                                try_files $uri =404;                                fastcgi_pass  unix:/tmp/php-cgi.sock;                                fastcgi_index index.php;                                include fastcgi.conf;                                include pathinfo.conf;  } 

  

pathinfo.conf內容

#vim /usr/local/nginx/conf/pathinfo.confset $path_info "";set $real_script_name $fastcgi_script_name;if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {                set $real_script_name $1;                set $path_info $2;}fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;fastcgi_param SCRIPT_NAME $real_script_name;fastcgi_param PATH_INFO $path_info;

  

儲存

 

#/etc/init.d/nginx restart

  


或者用 

#service nginx restart

重啟下nginx 在看下效果

 


這個是檔案沒有讀寫權限  

#cd /home/wwwroot/default

將目錄轉換到你環境所在的檔案

#chmod -R 777 /thinkphp

設定thinkphp檔案夾下面的檔案全都為777許可權

你的歡迎頁面出來啦 !!!!!

不出意外 你將看到hello World!~~

 

centos 支援ThinkPHP的pathinfo 配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.