mac本地基于nginx搭建wordPress的一些问题
问题描述
nginx是用brew安装的,nginx version: nginx/1.10.2
wordpress 也是最新版,是在官网下载的tar包解压的
在nginx的server文件夹下设置好root、index文件之后,通过浏览器访问wordpress的wp-admin/install.php,
然后出现了奇葩的问题,访问的结果不是正常打开网页,而是将install.php文件重新下载了一遍!!!!求教是可能的那个地方有问题。主要是没有报错,也不知道如何下手去搜索这种情况,于是来提问了,谢谢!
nginx.conf 配置(是默认的没有修改过)
#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/*;}
我额外设置的word_press.conf
server { listen 8081; server_name console.word-press.local; #绑定域名 location ~ .php$ {root /Users/lights/easyops/wordpress; #网站根目录index index.php index.html index.htm; #默认文件# root html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;includefastcgi_params; }}
问题解答
回答1:请贴一下你的nginx相关server配置的内容
这个问题要么是php-fpm没有设置,要么是try_files设置错误
回答2:你的PHP在Nginx里配置有问题,也就是说你本地的WEB服务器环境配置没有配置好,Nginx根本就无法解析.php文件!建议你搭建好Mac本地的Web环境后再安装 WordPress !
相关文章:
1. objective-c - 从朋友圈跳到我的APP 如何实现?2. java - PHP开发微信无法获取到signature,timestamp,nonce3. 请教一个python字符串处理的问题?4. HTML5禁止img预览该怎么解决?5. 怎么可以实现在手机浏览器看到链接的title属性,就是鼠标放上去会有一个tip效果的6. 如何分别在Windows下用Winform项模板+C#,在MacOSX下用Cocos Application项目模板+Objective-C实现一个制作游戏的空的黑窗口?7. 网页爬虫 - python爬虫用BeautifulSoup爬取<s>元素并写入字典,但某些div下没有这一元素,导致自动写入下一条,如何解决?8. html5 - h5+中webview的show方法有延迟9. javascript - vscode alt+shift+f 格式化js代码,通不过eslint的代码风格检查怎么办。。。10. javascript - html 中select如何修改样式,鼠标悬浮时改变option样式,有没有插件啊
