1

What I have: as title suggests I set up a WordPress installation on my local machine and can run it and visit it (Mac + MAMP) over localhost:8888/myBlog. It works fine. By sharing my IP I am able to reach the WordPress blog from another computer (myIP:8888/myBlog). But here is the problem.

The problem: the page loads, but not the .js, nor the .css. By inspecting the console I see six ERR_CONNECTION_REFUSED for js and css files coming from wp-content (.css and .js of a theme I installed) and from wp-includes (again .css and .js files).

What I tried: I thought it was a problem of permission so I changed the main folder and all the files recursively with chmod -R 575 as suggested somewhere but the problem persists.

Thanks!

  • What's the URL for the ERR_CONNECTION_REFUSED ? Is that still 'localhost', i.e. the other machines are trying to load the files from themselves not your server? Is the host, port and HTTP/HTTPS of those URLs correct? If they are, can you check the access and error logs of your web server? – Rup Mar 23 at 11:52
  • Yes! It's still localhost!! I didn't realize that... how can I fix this? – Masiar Mar 23 at 11:54
  • That's the 'WordPress address' and 'Site address' in Settings, General. You should set these to the URL your clients should be using, i.e. probably http://myIP:8888/myBlog – Rup Mar 23 at 11:56
  • That was it! Thank you so much! If you answer I can upvote & set as correct answer! – Masiar Mar 23 at 11:58
1

As discussed in comments, the problem was that the site address was set to localhost:8888/myBlog. This is the URL WordPress is expecting your clients to be using, and uses this to generate fully-qualified URLs for scripts and CSS etc. Hence your other clients were trying to load scripts and CSS from their own localhost.

The fix is to set the correct URL, http://myIP:8888/myBlog, as the 'WordPress Address' and 'Site Address' under Settings, General.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.