Server IP address could not be found
Posted by: inuke1 (202.12.95.---)
Date: October 26, 2018 06:23AM

Hi, i'm currently able to access my webpages from another PC using an Ethernet cable but am unable to reach one of the page.
It's the only html on the "server."
Other .php shows normally but when redirecting to the html i get:

"This site can't be reached."
test1's server IP address could not be found.
ERR_NAME_NOT_RESOLVED

i tried to do some searching but it all just tells me to add "Require all granted." to my host config, which i already did.

Need some help

Options: ReplyQuote
Re: Server IP address could not be found
Posted by: RiggsFolly (Moderator)
Date: October 28, 2018 02:49PM

Hi,

Are you sure that the url is correct for this link to your html page?

Post one that works and this one that does not

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Server IP address could not be found
Posted by: inuke1 (202.12.95.---)
Date: October 30, 2018 05:28AM

Ok i think i found the issue, i have to type the host IP at the start of the link.

In the PHP, i'm redirecting like this

header("Location: [prjtest1]winking smiley;

and i didn't add the host IP because i'm trying to make it such that if the IP address of the host changes i'm still able to run the page, is there a way i could do this?

Not sure if i'm making any sense.

Options: ReplyQuote
Re: Server IP address could not be found
Posted by: RiggsFolly (Moderator)
Date: October 30, 2018 09:51AM

Hi,

It sounds to me that you need to make yourself a Virtual Host and then this would work.

Have a look at this and thi as well

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Server IP address could not be found
Posted by: inuke1 (202.12.95.---)
Date: October 31, 2018 05:57AM

Hello, i do have a virtual host and when i type the virtual host name into the other PC it doesn't connect. Only connects when i type in the IP of the "localhost."

[imgur.com]

^This is the virtual host sitename on the local pc ^

Virtual host folder is located in wamp's www folder

Options: ReplyQuote
Re: Server IP address could not be found
Posted by: RiggsFolly (Moderator)
Date: October 31, 2018 11:36AM

Hi,

That is because the OTHER PC does not know about the domain name you created in your Virtual Host definition. Remember you create a VH and then you add the ServerName, the new domain name, to your HOSTS file so that the browser can locate the domain name and its associcated ip address in the Windows DNSCache as the HOSTS file seeds the Windows DNSCache.

So go to your OTHER PC and add an entry to it's HOSTS file with your new domain name and the ip address of the PC running WAMPServer. The WAMPServer PC should of course have a static IP Address so this never changes within your local network.


So on OTHER PC add this to its HOSTS file. For demonstration purposes I will assume your WAMPServer PC is running on ip address `192.168.0.10`


192.168.0.10  prjtest1
.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Server IP address could not be found
Posted by: inuke1 (202.12.94.---)
Date: November 01, 2018 10:33AM

Oh will try that out. Thanks!

Is it possible to not have to add a line in the host file whenever my IP address changes?

Cause my project requires me to be able to "connect automatically" on different PC's or on different IP-addresses.

If that made no sense what i'm trying to say is, is there any way i could configure the host files to auto detect the IP of the host server PC and updates itself? Doesn't have to be within the host files but is there a way i could make it such that if i use another different pc to access the web i won't have to manually configure the host files beforehand?

I've tried doing some searching but i don't know the exact keywords to use and all the results came up irrelevant.

Options: ReplyQuote
Re: Server IP address could not be found
Posted by: RiggsFolly (Moderator)
Date: November 01, 2018 11:32AM

Like I said in the previous answer, you need the PC running WAMPServer to have a static IP Address so it never changes.

See this and use the How to assign static IP address using Control Panel unless you are good with the command line

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Server IP address could not be found
Posted by: inuke1 (202.12.94.---)
Date: November 02, 2018 04:08AM

Thanks for replying!

I understand. However i will not be on the same PC hosting the server and will not be connected to the WIFI.

The host PC and guest PC will be connected to a switch instead. I'll have to move the files from the PC that i'm working on to another host PC.

I'm trying to think of something that will not require any configuration of the host files.


Scenario intended:
Transfer the php files to a different virtual host on another PC for hosting.
Connect the PCs to a switch.
Access the pages on the server on guest PCs that are connected to the host PC via a switch without having to configure the host files on the PCs or any lines in the .php(s).

Options: ReplyQuote
Re: Server IP address could not be found
Posted by: RiggsFolly (Moderator)
Date: November 02, 2018 12:36PM

Then you need to Install,Configure and maintain a local DNS Server.

Good luck

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.