Question

Transferring a wordpress installation, "Can't reach this page" on all pages possibly mysql related?

Hello, I am in the process of transferring a wordpress that was previously hosted on wamp on my home server, on to digital ocean. I am reciving an error on every page that simply says “can’t reach this page” on microsoft edge and chrome says ERR_CONNECTION_TIMEOUT

I followed the procedure here https://codex.wordpress.org/Moving_WordPress I imported the old database, and I have made sure that the username and password match in the wp config file. I am stumped as to what else might be causing the problem, any suggestions would be appreciated and I can certainly provide a lot more information, I just don’t really know what is needed.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

In general, it’s a very bad idea to hack up your wp-config.php + way better to fix your runtime environment so your install simply works.

First get everything working with pure Apache (remove NGINX).

Steps…

  1. Use netstat -pluten to ensure apache is really listening on port 80 + 443.

  2. If Apache is truly listening + setup correctly, you should see the Apache default page for non-SSL (port 80) access. Fix this before proceeding.

  3. Setup your Apache config + run apachectl -t + ensure you get an OK before proceeding.

  4. At this point you should have your WordPress root directory serving.

  5. Deploy your WordPress installation via backup restore or wp-cli or however you do it.

All should be well.

  1. The muck about with NGINX (shudder), which will only slow down well tuned LAMP Stacks, so if your site will be receiving significant traffic, better to tune your LAMP Stack, rather than attempt fixing poor LAMP Stack tuning via NGINX or Varnish or CDN or any other cruft between Apache + your money (visitors).

@tommyconner96

The error log definitely doesn’t help in this case as all that’s showing is that Apache was restarted.

Is this the only site on the Droplet? If so, and there’s only one Apache VirtualHost setup, can you try to change the URL on the WordPress site to the IP of your Droplet and see if you’re able to access it?

Inside of wp-config.php, add the following:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Replace http://example.com with your Droplet IP. For example, if you’re Droplet IP is:

111.22.33.44

You’d use:

define('WP_HOME','111.22.33.44');
define('WP_SITEURL','111.22.33.44');

That’ll make it so that WordPress responds by IP instead of by domain. If that works, then the issue is either related to your VirtualHost configuration or it’s a DNS issue.

We’d then need to take a look at your VirtualHost file, your DNS, or both. You’d generally get an error relating to DNS in Chrome when DNS is not correctly setup, so the issue may very well be with the VirtualHost.

If you can paste that in to a response using a code block (to ensure proper formatting), I’ll be more than happy to take a look at it for you.

@tommyconner96

The error itself doesn’t say much about what’s going on, so we’d need to check the error logs to see if there anything showing up there first and foremost.

If you’re using Apache, we can get the last 20 lines using:

tail -20 /var/log/apache2/error.log

If you’re using NGINX, we can get the last 20 lines using:

tail -20 /var/log/nginx/error.log

If you can paste the output of either command (whichever server you’re running), we can see if the logs are able to tell us anything.