View Site goes to blank page

Specs:
macOS 10.13.6
Local by Flywheel 2.2.4

I have a live website that I wanted to do some work on locally, so I downloaded the website and imported it into Local by Flywheel.
Webserver: Apache
PHP version 5.4.45 (the live website is at 5.4)
MySQL version 5.5.55

This problem is very similar to View Site Not Working (URL Blank on Web Browser) but the solutions suggested there didn’t work. So that you don’t have to read that thread unless you want to:

  • In Local by Flywheel, when I click the Admin button, I can see the wp-admin login page and log in and everything looks fine.
  • When I click the View Site button (or navigate straight to the URL in a browser), then I get a blank white page in Chrome or Safari. (In Firefox I get a warning about my connection being insecure, but I don’t really need Firefox to work if one of the others does.)
  • Restarting Chrome (or typing chrome://restart in the browser bar) didn’t work (that was one of the solutions suggested in that thread).

Some details in case this helps:

In Chrome DevTools, on the network tab (I copied these June 30 when I first posted about this problem):

Request headers on the real site (which isn't "mysite.com"):
    GET / HTTP/1.1
    Host: mysite.com
    Connection: keep-alive
    Cache-Control: max-age=0
    Upgrade-Insecure-Requests: 1
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
    Accept-Encoding: gzip, deflate, br
    Accept-Language: en-US,en;q=0.9
    Cookie: _tccl_visitor=1e34c96b-4758-401a-9dbb-0ca6da02439c; _tccl_visit=1f9d2711-9355-48d7-bfa5-018a16ca85a6

Response headers on the real site:
    HTTP/1.1 200 OK
    Date: Sat, 30 Jun 2018 21:07:57 GMT
    Server: Apache
    X-Powered-By: PHP/5.4.45
    Link: <https://mysite.com/wp-json/>; rel="https://api.w.org/"
    Vary: Accept-Encoding,User-Agent
    Content-Encoding: gzip
    Content-Length: 7082
    Keep-Alive: timeout=5
    Connection: Keep-Alive
    Content-Type: text/html; charset=UTF-8

The request headers on the local site looked quite a bit different:
    :authority: mysite.local
    :method: GET
    :path: /
    :scheme: https
    accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
    accept-encoding: gzip, deflate, br
    accept-language: en-US,en;q=0.9
    cache-control: max-age=0
    cookie: wp-settings-1=editor%3Dhtml%26libraryContent%3Dbrowse%26wplink%3D1%26align%3Dcenter%26imgsize%3Dfull%26post_dfw%3Doff%26posts_list_mode%3Dlist%26urlbutton%3Dcustom; wp-settings-time-1=1530390999; wordpress_test_cookie=WP+Cookie+check
    upgrade-insecure-requests: 1
    user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Response headers on the local site:
    HTTP/1.1 200 OK
    Content-Length: 0
    content-type: text/html; charset=UTF-8
    Date: Sat, 30 Jun 2018 21:07:57 GMT
    Link: <https://mysite.local/wp-json/>; rel="https://api.w.org/"
    server: nginx/1.10.1
    status: 200
    X-Powered-By: PHP/5.4.45

I noticed in Nginx headers for Apache server? the explanation about the reverse proxy & nginx, so I’m not worried about the response server saying it’s nginx.

Hey @reepicheep78,

I would advise you to look for the .htaccess hidden file in your Wordpress root, something there can be looping or redirecting the website somewhere non-existant if you copied it from the live server. Even tough you can access the wp-admin page, which is a redirect made by Wordpress.

Also, what was the method used for migrating the website from your live environment to Local? Did you check all the tables in the database to be sure everything is fine?
Are you using the Custom Environment from Local?

Note as well that Wordpress recommended PHP version is 7.2 (but various versions well supported by 5.6), and this might be causing issues with your specific website in Local (even if it works in the live environment). But that’s for a developer to understand haha

Those are the main basic things I thought with the data you showed and the related threads you gave.
It most likely is something to do with the migration of the website itself, rather than a bug related to Local. But there is a possibility of the latter.

Hi atempel, thanks for the feedback & suggestions of where to start looking for the problem. I’m having some interruptions this week, so I’ll have to sleep on it and try more ideas later.

To follow-up:
There seems to be an issue with one of the third-party template’s files that was causing the site to return a blank page without logging an error (at least, I didn’t get an error report until I tried explicitly loading home.html). So the cause of the blank page is a PHP issue that I’m now tracking down.

If anyone else runs across an issue like this: I started at the site’s index.php and started putting in error_log('In file abc now'); statements and found where the execution was stopping to know in what file to look.