PHP - How do I find the wampserver ipv4 address in online mode?

Asked

Viewed 484 times

1

What happens is that I am using websockets and accessing in other devices by wampserver online mode, I access in different networks, with this every time it changes ipv4. Is there any way to grab and for example redirect to that ip?

  • very confused and vague what you explained but I think I understand.. you have an apache installed on a pc or notebook, anyway, something that somehow you are always connecting on a different network, right ? So what you want to do is network devices connect to your pc or note through the ip but be something automatic through an IP or a name that redirects to the "portable server". That’s it ?

  • Yes! I need to discover ipv4 to open in the browser of a mobile phone for example.

  • How hard is it to see ip by cmd using ipconfig /all ? Wouldn’t it be much simpler? Having ip, just inform the person with the mobile phone or other device , access by ip ...

  • I do this, but other people will use this system and I thought if I could get it automatically it would be better.

  • 1

    yeah, it doesn’t. unless you register your pc/note on those third-party networks. You’d have to switch all of them from automatic ip to static ip.. It takes a lot of work. Depending on the structures and conditions, it is often too invasive or unviable.. Maybe, something simpler, if you don’t want to have the job of opening cmd and such, then run this <?php echo gethostbyname(gethostname());? > whenever you join a network and already leaves the browser open with very large letter. there are ways to solve as you want but it will take more work

  • That actually solved my problem! He returned my current ipv4: 192.168.1.8

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.