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 ?

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.5 32 bit - Apache 2.4.46d - PHP 8.0.3…5.6.40 - MySQL 5.7.33 - MariaDB 10.5.9
Wampserver 3.2.5 64 bit - Apache 2.4.46d - PHP 8.0.3…5.6.40 - MySQL 5.7.33/8.0.23 - MariaDB 10.5.9
PhPMyadmin 5.0.4 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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 )

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.5 32 bit - Apache 2.4.46d - PHP 8.0.3…5.6.40 - MySQL 5.7.33 - MariaDB 10.5.9
Wampserver 3.2.5 64 bit - Apache 2.4.46d - PHP 8.0.3…5.6.40 - MySQL 5.7.33/8.0.23 - MariaDB 10.5.9
PhPMyadmin 5.0.4 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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.