• I’m having the hardest time setting up WordPress with my local server today! Fair warning: the problem is most likely user error 😉 and I’m hoping to find a bit of sysadmin help over here.

    My attempts are two-fold, one is to have a nifty, fast, local, nginx server running on php7 and mysql whatever version and the other is to have a place I can break WordPress to my heart’s content. I wanted something super fast and custom, didn’t want to use VVV, Xamppp, Mamp, Wamp, etc.

    I set up php 7.0.8 and nginx 1.10.1 alongside mysql 5.7.13 via homebrew on my OS X 10.11.5 MacBook Pro. Once I got all that sorted, everything does seem to work, php scripts work, phpmyadmin runs a-ok, but WordPress fails with a 502 Bad Gateway error! The nginx error log file says:

    2016/07/01 16:27:38 [error] 37422#0: *206 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /wp-trunk/wp-admin/setup-config.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost", referrer: "http://localhost/"

    I tried to check to make sure fastcgi is listening on the right port (am I doing this right?) with this:

    lsof -Pni4 | grep LISTEN | grep php

    And the output looks like this:

    php-fpm   37244 designsimply    9u  IPv4 0x6d66db27bb08f2f5      0t0  TCP 127.0.0.1:9000 (LISTEN)
    php-fpm   37707 designsimply    0u  IPv4 0x6d66db27bb08f2f5      0t0  TCP 127.0.0.1:9000 (LISTEN)
    php-fpm   37721 designsimply    0u  IPv4 0x6d66db27bb08f2f5      0t0  TCP 127.0.0.1:9000 (LISTEN)
    php-fpm   39643 designsimply    0u  IPv4 0x6d66db27bb08f2f5      0t0  TCP 127.0.0.1:9000 (LISTEN)

    My nginx config files are like so:

    1. https://github.com/designsimply/bin/blob/master/nginx.conf
    2. https://github.com/designsimply/bin/blob/master/nginx-localhost
    3. https://github.com/designsimply/bin/blob/master/fastcgi.conf

    I’ve tried modifying the nginx.conf and nginx-localhost files in so many ways I can’t remember them all now. I figure I’m doing something wrong with those since phpmyadmin seems to work without any troubles (installed in a folder at localhost root). I also searched the interwebs and there is evidence afoot that I should be able to get WP working with php7 (which I thought might be a problem?).

    Can anyone help me figure out what I’m doing wrong with my setup based on the description above?

Viewing 1 replies (of 1 total)
  • Dion

    (@diondesigns)

    WordPress runs fine with PHP 7.0. Plugins/themes are another story entirely, but that’s a different topic. (And be aware that phpMyAdmin has a couple serious PHP 7.0-specific bugs in its import/export modules.)

    Of more concern is that WordPress is somewhat tied to .htaccess files, and nginx does not support .htaccess files. It is why I never set up client servers with nginx if they are using WordPress (or Joomla, or several other applications that make extensive use of .htaccess files).

    You’re probably better off asking your question at places like serverfault or stackexchange — or perhaps an nginx support site.

Viewing 1 replies (of 1 total)
  • The topic ‘"upstream prematurely closed connection while reading response header"’ is closed to new replies.