I cant acces to localhost/wordpress from my phone

Problems with the Windows version of XAMPP, questions, comments, and anything related.

I cant acces to localhost/wordpress from my phone

Postby jsdanielq » 27. July 2019 02:37

Hi! please i need you to help me i've been weeks trying to fix this problem i can access to localhost from my phone and everything is perfect but when i click my folder wordpress it doesn't work and i don't know what is happening.

Image Image
jsdanielq
 
Posts: 5
Joined: 27. July 2019 02:23
XAMPP version: 3.2.4
Operating System: windows

Re: I cant acces to localhost/wordpress from my phone

Postby Altrea » 27. July 2019 10:16

We need the contents of your Apache access.log and error.log of the time around the error occurs.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: I cant acces to localhost/wordpress from my phone

Postby jsdanielq » 27. July 2019 13:14

access.log said : "http://192.168.1.44:8080/dashboard/" "Mozilla/5.0 (Linux; Android 9; moto g(6)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36"

when i try to enter in tho the wordpress folder it doesn't sent any error on the logs.

the last content in errors.log is : [Sat Jul 27 13:57:37.079162 2019] [php7:warn] [pid 9308:tid 1900] [client ::1:53268] PHP Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 11 in C:\\xampp\\htdocs\\jq\\wp-content\\plugins\\js_composer\\include\\autoload\\hook-vc-grid.php on line 163, referer: http://localhost:8080/jq/wp-admin/nav-menus.php
jsdanielq
 
Posts: 5
Joined: 27. July 2019 02:23
XAMPP version: 3.2.4
Operating System: windows

Re: I cant acces to localhost/wordpress from my phone

Postby Nobbie » 27. July 2019 15:06

Forget about that preg_match warning, as it is only a warning.

The problem is that you installed WordPress to "localhost" (and applied "localhost" in the setup as hostname). WordPress does a redirect to the hostname for each document, but when you access WordPress via 192.168.39, then WordPress also does a redirect to "localhost", but in that context, "localhost" is your smartphone (and not the Xampp server). Therefore the request fails.

If you want to access WordPress from another PC or a smartphone, you MUST NOT apply "localhost" as hostname, instead you should apply the IP 192.168.39 at installation time. Maybe you can fix this error in wp-config.php, edit the file and replace the hostname (or servername or server URL or whatever, i dont know WordPress well and this is NOT a WordPress forum!) from "localhost" to "192.168.39". If in doubt, ask in a WordPress forum how to apply another servername AFTER installation.
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: I cant acces to localhost/wordpress from my phone

Postby jsdanielq » 27. July 2019 18:01

Nobbie wrote:Forget about that preg_match warning, as it is only a warning.

The problem is that you installed WordPress to "localhost" (and applied "localhost" in the setup as hostname). WordPress does a redirect to the hostname for each document, but when you access WordPress via 192.168.39, then WordPress also does a redirect to "localhost", but in that context, "localhost" is your smartphone (and not the Xampp server). Therefore the request fails.

If you want to access WordPress from another PC or a smartphone, you MUST NOT apply "localhost" as hostname, instead you should apply the IP 192.168.39 at installation time. Maybe you can fix this error in wp-config.php, edit the file and replace the hostname (or servername or server URL or whatever, i dont know WordPress well and this is NOT a WordPress forum!) from "localhost" to "192.168.39". If in doubt, ask in a WordPress forum how to apply another servername AFTER installation.



I already change my servername to my Ip, but i can't still access.

my question is not about wordpress, it's why can i access to my localhost root page but not to the wordpress folder?
jsdanielq
 
Posts: 5
Joined: 27. July 2019 02:23
XAMPP version: 3.2.4
Operating System: windows

Re: I cant acces to localhost/wordpress from my phone

Postby jsdanielq » 27. July 2019 18:06

Don't worry i found a tutorial how teach me how to fix the problem! thankyou!
jsdanielq
 
Posts: 5
Joined: 27. July 2019 02:23
XAMPP version: 3.2.4
Operating System: windows

Re: I cant acces to localhost/wordpress from my phone

Postby Altrea » 27. July 2019 18:48

So what was the problem and how did you solve it?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: I cant acces to localhost/wordpress from my phone

Postby Nobbie » 27. July 2019 19:04

jsdanielq wrote:my question is not about wordpress, it's why can i access to my localhost root page but not to the wordpress folder?


Very funny, indead.

You can access localhost (which means, you can access Xampp), but you cannot access WordPress?! But your problem is still NOT about WordPress? Whatelse?? Joomla? Chess? Football?
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: I cant acces to localhost/wordpress from my phone

Postby jsdanielq » 27. July 2019 20:13

I try a lot of thing, i don't know exactly winchone worked

1- in xamp control panel - i changed my apache serverport to 8080
2- in httpd.conf - change the servername to mi ip 192.x.x.x.:8080
3- add this code to htppd-xamp.conf:
#
# New XAMPP security concept
#

# Close XAMPP security section here
<LocationMatch “^/(?i:(?:security))”>
Order deny,allow
#Deny from all
#Allow from ::1 127.0.0.0/8
Allow from all
ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

# Close XAMPP sites here
<LocationMatch “^/(?i:(?:xampp|licenses|phpmyadmin|webalizer|server-status|server-info))”>
Order deny,allow
#Deny from all
#Allow from ::1 127.0.0.0/8
Allow from all
ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

4- in phpmyadmin DDBB on table wp_options:
- in siteurl: change from localhost to 192.168.x.x/namefolder
-in home: change from localhost to 192.168.x.x/namefolder

5- in system32/drivers/etc/host
- add after the last line: # 192.168.x.x(your ip) apacheserver

then i empty cache and some of those step make it works
jsdanielq
 
Posts: 5
Joined: 27. July 2019 02:23
XAMPP version: 3.2.4
Operating System: windows

Re: I cant acces to localhost/wordpress from my phone

Postby Altrea » 27. July 2019 20:43

It was step 4 which solved your issue. That's exactly what matches your explanation. By the way that is what Nobbie told you too, a WordPress configuration issue.

I would not recommend to follow any of the other steps. They lower your xampp security level and are relying on old configuration settings xampp didn't use any more.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 126 guests