Problem with DOCUMENT_ROOT when accessing virtualhosts remotely
Posted by: lowwhistler (---.hsd1.wa.comcast.net)
Date: March 17, 2021 07:02PM

WAMP 3.2.0
Win 10 x64

I have a problem accessing virtualhost include files from other devices on my local network. Everything works fine on the host PC.

I created a test file:
<?php
$INC_DIR = $_SERVER['DOCUMENT_ROOT']."/includes/";
echo($INC_DIR);
?>

On the local PC this correctly returns: C:/wamp64/www/RWCCBS/includes/

On another PC on the same LAN it returns: C:/wamp64/www/includes/ i.e. it's missing the virtualhost directory.

Is this anything to do with the +FollowSymLinks in the httpd-vhosts.conf file?

Thank in advance for any assistance...

Options: ReplyQuote
Re: Problem with DOCUMENT_ROOT when accessing virtualhosts remotely
Posted by: Otomatic (Moderator)
Date: March 17, 2021 08:11PM

Hi,

How do you access to Wampserver from other PC on LAN?
What do type on the browser ?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Problem with DOCUMENT_ROOT when accessing virtualhosts remotely
Posted by: lowwhistler (---.hsd1.wa.comcast.net)
Date: March 17, 2021 08:20PM

10.0.0.101/RWCCBS

Options: ReplyQuote
Re: Problem with DOCUMENT_ROOT when accessing virtualhosts remotely
Posted by: Otomatic (Moderator)
Date: March 18, 2021 09:33AM

Hi,

> 'http://10.0.0.101/RWCCBS'
Provided that :
- 10.0.0.101 is the fixed local IP of the PC hosting the server
- RWCCBS is the ServerName of the VirtualHost duly created
- RWCCBS is well recognized as VirtualHost by Apache
(See Right-Click -> Tools )

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Problem with DOCUMENT_ROOT when accessing virtualhosts remotely
Posted by: lowwhistler (---.hsd1.wa.comcast.net)
Date: March 18, 2021 05:22PM

Yes, all correct. Let me try and be clearer about the problem.
On the PC where WAMP is installed, all pages are served OK.
On any other PC on the local network, the pages are served, but without any included files.
To find out what was going wrong, I created a simple page to just return the string to the include file directory and that was the problem. The local PC saw the correct path, the other PCs saw a path to the main WWW without the virtual directory name.

Options: ReplyQuote


Sorry, only registered users may post in this forum.