admin管理员组文章数量:1398827
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 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!
Share Improve this question edited Mar 23, 2020 at 11:53 Masiar asked Mar 23, 2020 at 11:39 MasiarMasiar 1134 bronze badges 4 |1 Answer
Reset to default 1As 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.
本文标签:
版权声明:本文标题:javascript - Wordpress on localhost working, when sharing IP to connect receive err_connection_refused on .js and .css files 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744647702a2617496.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
http://myIP:8888/myBlog
– Rup Commented Mar 23, 2020 at 11:56