2015-07-21 153 views
1

我正嘗試在LEMP安裝程序的Linux VPS中安裝一個WordPress站點。到目前爲止,我已經完成了設置wordpress文件併爲WP目錄/文件中的nginx用戶/組設置所有權,但是當我訪問WP(https://domain.tld/wp-admin/install.php)的安裝頁面時,我最終得到了一個php文件下載代替。在Nginx上安裝Wordpress的錯誤

下面是爲WP網站我的虛擬主機配置:

server { 
 
\t listen 80; 
 
\t server_name domain.tld; 
 
\t return 301 https://$server_name$request_uri; 
 
} 
 

 
server { 
 
\t listen 443 ssl; 
 

 
\t ssl on; 
 
\t ssl_certificate /directory/to/crt; 
 
\t ssl_certificate_key /directory/to/key; 
 
\t 
 
\t server_name domain.tld; 
 
\t root /var/www/html/domain.tld; 
 
\t index index.php index.html index.htm; 
 

 
\t location/{ 
 
\t try_files $uri $uri/ /index.php?q=$uri&$args; 
 
\t } 
 

 
\t rewrite /wp-admin$ $scheme://$host$uri/ permanent; 
 
\t \t  
 
\t error_page 404 /404.html; 
 
\t error_page 500 502 503 504 /50x.html; 
 

 
\t location = /50x.html { 
 
\t root /usr/share/nginx/html; 
 
\t } 
 

 
\t location ~ \.php$ { 
 
\t try_files $uri =404; 
 
\t fastcgi_split_path_info ^(.+\.php)(/.+)$; 
 
\t fastcgi_pass unix:/var/run/php5-fpm.sock; 
 
\t fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
 
\t fastcgi_index index.php; 
 
\t include fastcgi_params; 
 
\t } 
 
}

編輯:我試圖在Firefox和它的作用不同於在Chrome中。 install.php頁面代替了這樣的錯誤頁面:

An error occurred。

對不起,您正在查找的頁面目前無法使用。 請稍後再試。

如果您是此資源的系統管理員,那麼您應該檢查>錯誤日誌以瞭解詳細信息。

忠實於你,nginx。

+0

你能夠訪問服務器的錯誤日誌? –

回答

0

我現在工作了。錯誤出現在虛擬主機的* .conf文件中。我得到了php-fpm sock的目錄錯誤。所以這就是php不能在網站上工作的原因,而只是下載了install.php文件,而域名卻是錯誤的。

fastcgi_pass unix:/var/run/php5-fpm.sock; < ----我剛剛在這個目錄中找到了錯誤的目錄。

0

也許只是而忘開始你的PHP-FPM

cd /usr/local/php7-chanxiao/etc/         

../sbin/php-fpm