$_SERVER['DOCUMENT_ROOT'] give wrong path

Status
Not open for further replies.

mickaelm

New Member
Messages
2
Reaction score
0
Points
1
Hi,

My following code :
require_once($_SERVER['DOCUMENT_ROOT'].'/conf/php_source.php');
give me the following error :
Warning: require_once(/usr/local/apache/htdocs/conf/conf_connexion.php): failed to open stream: No such file or directory in /home/mickaelm/public_html/cat-import.fr/conf/php_source.phpon line 17
Fatal error: require_once(): Failed opening required '/usr/local/apache/htdocs/conf/conf_connexion.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mickaelm/public_html/cat-import.fr/conf/php_source.php on line 17

Is it normal that the $_SERVER['DOCUMENT_ROOT'] give the value "/home/mickaelm/public_html/cat-import.fr"?
Is there a ways to fix this on the server side?

Thanks for your help,

Mickaël
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi Mickaël,

It appears that you are currently on the server "xo1", which was recently migrated from using Litespeed to Apache. It seems that, as a result of this, the document_root server variable is no longer pointing to the correct place. We are aware of the issue, and it will be fixed soon. :)

Thank you,
 

mickaelm

New Member
Messages
2
Reaction score
0
Points
1
Thanks for your response.
Do you know approximatively when this issue will be fixed?

Thanks
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi mickaelm,

We are actively working on getting this resolved, but I don't have an estimate on when this will be fixed I'm afraid. You can see our status website for updates, however. :)

http://status.x10hosting.com/

Thank you,
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
In the meantime while we are working on a fix, you can work around the issue by using either relative paths or making use of __DIR__, e.g. require_once __DIR__ . '/conf/php_source.php'; -- __DIR__ expands to the full directory of the current PHP file.
 

ebookx10

New Member
Messages
7
Reaction score
0
Points
1
Same problem
I have try with
PHP:
$_SERVER["X_DOM"]
and it works :)
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi ebookx10,

The $_SERVER['DOCUMENT_ROOT'] variable appears to be set fine on your account's server, xo3. :)

Thank you,
 
Status
Not open for further replies.
Top