mac本地基于nginx搭建wordPress的一些問(wèn)題
問(wèn)題描述
nginx是用brew安裝的,nginx version: nginx/1.10.2
wordpress 也是最新版,是在官網(wǎng)下載的tar包解壓的
在nginx的server文件夾下設(shè)置好root、index文件之后,通過(guò)瀏覽器訪(fǎng)問(wèn)wordpress的wp-admin/install.php,
然后出現(xiàn)了奇葩的問(wèn)題,訪(fǎng)問(wèn)的結(jié)果不是正常打開(kāi)網(wǎng)頁(yè),而是將install.php文件重新下載了一遍!!!!求教是可能的那個(gè)地方有問(wèn)題。主要是沒(méi)有報(bào)錯(cuò),也不知道如何下手去搜索這種情況,于是來(lái)提問(wèn)了,謝謝!
nginx.conf 配置(是默認(rèn)的沒(méi)有修改過(guò))
#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pidlogs/nginx.pid;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; #log_format main ’$remote_addr - $remote_user [$time_local] '$request' ’ # ’$status $body_bytes_sent '$http_referer' ’ # ’'$http_user_agent' '$http_x_forwarded_for'’; #access_log logs/access.log main; sendfileon; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server {listen 8080;server_name localhost;#charset koi8-r;#access_log logs/host.access.log main;location / { root html; index index.html index.htm;}#error_page 404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location = /50x.html { root html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ .php$ {# proxy_pass http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ .php$ {# root html;# fastcgi_pass 127.0.0.1:9000;# fastcgi_index index.php;# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;# includefastcgi_params;#}# deny access to .htaccess files, if Apache’s document root# concurs with nginx’s one##location ~ /.ht {# deny all;#} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { #root html; #index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { #root html; #index index.html index.htm; # } #} include servers/*;}
我額外設(shè)置的word_press.conf
server { listen 8081; server_name console.word-press.local; #綁定域名 location ~ .php$ {root /Users/lights/easyops/wordpress; #網(wǎng)站根目錄index index.php index.html index.htm; #默認(rèn)文件# root html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;includefastcgi_params; }}
問(wèn)題解答
回答1:請(qǐng)貼一下你的nginx相關(guān)server配置的內(nèi)容
這個(gè)問(wèn)題要么是php-fpm沒(méi)有設(shè)置,要么是try_files設(shè)置錯(cuò)誤
回答2:你的PHP在Nginx里配置有問(wèn)題,也就是說(shuō)你本地的WEB服務(wù)器環(huán)境配置沒(méi)有配置好,Nginx根本就無(wú)法解析.php文件!建議你搭建好Mac本地的Web環(huán)境后再安裝 WordPress !
相關(guān)文章:
1. javascript - vscode alt+shift+f 格式化js代碼,通不過(guò)eslint的代碼風(fēng)格檢查怎么辦。。。2. javascript - 這不是對(duì)象字面量函數(shù)嗎?為什么要new初始化?3. javascript - [js]為什么畫(huà)布里不出現(xiàn)圖片呢?在線(xiàn)等4. javascript - 如何將一個(gè)div始終固定在某個(gè)位置;無(wú)論屏幕和分辨率怎么變化;div位置始終不變5. javascript - 原生canvas中如何獲取到觸摸事件的canvas內(nèi)坐標(biāo)?6. javascript - 求解答:實(shí)例對(duì)象調(diào)用constructor,此時(shí)constructor內(nèi)的this的指向?7. javascript - 有什么比較好的網(wǎng)頁(yè)版shell前端組件?8. html - vue項(xiàng)目中用到了elementUI問(wèn)題9. html5 - 有可以一次性把所有 css外部樣式轉(zhuǎn)為html標(biāo)簽內(nèi)style=" "的方法嗎?10. python - 如何判斷爬蟲(chóng)已經(jīng)成功登陸?
