I have a simple problem with the server global variable named : DOCUMENT_ROOT.
Here’s my config.php file :
<?php
define ('UPLOAD_DIR',$_SERVER['DOCUMENT_ROOT'].'/resouces/');
The test.php file
<?php
$photo='myimage.php';
echo '<img src="'.UPLOAD_DIR.$photo.'">';
The problem is that when testing the code.. The image doesn’t display, and the directory starts with :
C://program files/easyPHP/www/resources
instead of
As it supposed to be… I tried to update this line in the httpd.conf file :
DocumentRoot "${path}/www"
to
DocumentRoot "http://127.0.0.1:8888/www"
But the server declares an error :

Thank you in advance 🙂
$_SERVER['DOCUMENT_ROOT']is path on your real filesystem.You need not it here.
Just use
Don’t mix up path on filesystem and path on your site.
They may have nothing common (but in default case requested
URIsent to$_SERVER['DOCUMENT_ROOT'].URI)You can also use
You need not declare it on every levelb ecause path starts from root
/