Einige Probleme beim lokalen Erstellen von WordPress basierend auf Nginx auf dem Mac
伊谢尔伦
伊谢尔伦 2017-05-16 17:10:46
0
2
426

nginx wird mit brew installiert, Nginx-Version: nginx/1.10.2

Wordpress ist auch die neueste Version, die aus dem von der offiziellen Website heruntergeladenen TAR-Paket extrahiert wird

Nachdem Sie die Stamm- und Indexdateien im Serverordner von Nginx eingerichtet haben, greifen Sie über den Browser auf wp-admin/install.php von WordPress zu,

Dann trat ein seltsames Problem auf, das dazu führte, dass die Webseite nicht normal geöffnet wurde, sondern die Datei install.php erneut heruntergeladen wurde! ! ! !
Wenn Sie um Rat fragen, ist es möglich, dass irgendwo ein Problem vorliegt.
Der Hauptgrund ist, dass kein Fehler gemeldet wurde und ich nicht weiß, wie ich mit der Suche nach dieser Situation beginnen soll. Deshalb bin ich gekommen, um eine Frage zu stellen. Vielen Dank!

nginx.conf-Konfiguration (die Standardeinstellung wurde nicht geändert)

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/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;

    sendfile        on;
    #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;
        #    include        fastcgi_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/*;
}

Meine zusätzliche 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;
        include        fastcgi_params;
    }
}
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

Antworte allen(2)
仅有的幸福

请贴一下你的nginx相关server配置的内容

这个问题要么是php-fpm没有设置,要么是try_files设置错误

伊谢尔伦

你的PHP在Nginx里配置有问题,也就是说你本地的WEB服务器环境配置没有配置好,Nginx根本就无法解析.php文件!
建议你搭建好Mac本地的Web环境后再安装 WordPress !

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!