document_root on vHost

Currently reading
document_root on vHost

2
0
NAS
DS716j
Operating system
  1. Windows
My last question has not been answered, probably I was not clear enough (I am just a hobby-programmer and still fighting with the theme). I'll try it more precise:

On my Synology NAS DS716j I created a virtual Host (Website).
The configuration of the vHosts shows me, that Document_Root points to web/Website.

When I open this website in my browser (http://192.168.1.22/Website/ ), and query for $_Server["DOCUMENT_ROOT"], I receive following result:
"/var/services/web"

What can I do, that Document Root points to "/var/services/web/Website (respectively to /Website) ?

The reason is, that I need absolute path for my Include/require commands.
Example:
<?php include $_SERVER["DOCUMENT_ROOT"] . '/phpadds/header.php'; ?>
Failed opening '/var/services/web/phpadds/head.php'

My Website is hosted on a hosting-Server. I use NAS to develop my website. Therefore, it would be good, weather I could use the same include on both environments. The Include works on the hoster.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top