lnmp完美搭建核心thinkphp5的易優CMS站點配置
1、概述
易優CMS核心採用thinkphp5,有些nginx伺服器不能訪問,是因為要開啟pathinfo。
2、配置
修改 php.ini 支援 pathinfo
php配置檔案:/usr/local/php/etc/php.ini
更改php.ini
- 找到:cgi.fix_pathinfo=0 更改為:cgi.fix_pathinfo=1
- 找到:scandir,去掉禁止函式中的 scandir
3、配置nginx新站點
server
{
listen 80;
server_name www.xxxxxxx.com xxxxxxx.com;
index index.php index.html index.htm default.html default.htm default.php;
root /home/wwwroot/www.xxxxxxx.com/;
include none.conf;
#error_page 404 /404.html;
#include enable-php.conf;
include enable-php-pathinfo.conf;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
if ($host != 'www.xxxxxxx.com' ) {
rewrite ^/(.*)$ http://www.xxxxxxx.com/$1
permanent;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
#access_log /home/wwwlogs/www.xxxxxxx.com.log;
}
enable-php-pathinfo.conf 檔案程式碼:
location ~ [^/]\.php(/|$)
{
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
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;
}
4、重啟
lnmp restart
注意:
一定要帶上 include enable-php-pathinfo.conf;
否則會報404錯誤
相關文章
- LNMP配置優化LNMP優化
- 一個基於ThinkPHP5的CMS系統PHP
- Nginx網站服務LNMP搭建論壇Nginx網站LNMP
- LNMP網站框架搭建(編譯安裝)LNMP網站框架編譯
- 搭建 VuePress 站點必做的 10 個優化Vue優化
- lnmp搭建LNMP
- lnmp 一鍵安裝包部署ThinkPHP5LNMPPHP
- ubuntu14.04 lnmp nginx 虛擬主機(多站點 多域名) 配置UbuntuLNMPNginx
- Nginx 實踐案例(原始碼編譯安裝方式):利用LNMP搭建wordpress站點Nginx原始碼編譯LNMP
- LNMP搭建HDwikiLNMP
- LNMP環境VPS搭建織夢DEDECMS網站教程LNMP網站
- LNMP 環境搭建LNMP
- 搭建lnmp環境LNMP
- lnmp環境搭建LNMP
- 快速搭建 Linux(LNMP + Linux 安裝 + 環境配置)LinuxLNMP
- 網站搭建教程第三課——WordPress站點搭建網站
- Headless CMS 作為多站點管理的制勝策略 - DatoCMS
- 基於 LNMP 的 Nginx 百萬併發之路 (一)核心要素、模組、配置概述LNMPNginx
- CMS大型入口網站網站
- docker搭建lnmp環境DockerLNMP
- docker 搭建 lnmp 環境DockerLNMP
- 如何搭建LNMP環境LNMP
- ubuntu lnmp環境搭建UbuntuLNMP
- 記錄一次 LNMP 環境搭建到 Https 配置LNMPHTTP
- 通過Git簡易的部署靜態站點Git
- nginx多站點配置Nginx
- 歪酷CMS官方網站網站
- Linux下-LNMP環境搭建部落格網站(全過程)LinuxLNMP網站
- PHP-lnmp 環境搭建PHPLNMP
- Docker LNMP Redis 環境搭建DockerLNMPRedis
- Windows 下搭建 lnmp 環境WindowsLNMP
- LNMP環境搭建(二):NginxLNMPNginx
- Ubuntu16.04搭建LNMPUbuntuLNMP
- Ubuntu14.04搭建LNMPUbuntuLNMP
- LNMP環境搭建——Nginx篇LNMPNginx
- 站點優化記錄優化
- CentOS7搭建個人站點CentOS
- 如何配置https站點HTTP