$_SERVER['document_root'] - can't get it to work


#1

I’m trying to get a site up, which I’ve moved from localhost. But I’m encountering this problem:

Warning: require(/mydirectory/php/simplepie.inc) [function.require]: failed to open stream: No such file or directory in /home/.zerbe/myaccount/mysite.com/mydirectory/segments.inc on line 9

Fatal error: require() [function.require]: Failed opening required ‘/mydirectory/php/simplepie.inc’ (include_path=’.:/usr/local/php5/lib/php:/usr/local/lib/php’) in /home/.zerbe/myaccount/mysite.com/mydirectory/segments.inc on line 9

Lines 8 and 9 in segments.inc look like this:

require(‘globals.inc’);
require(SITE_URL . ‘/php/simplepie.inc’);

And globals.inc looks like this:

define(‘SITE_URL’, $_SERVER[‘document_root’] . ‘/mydirectory’);

Any advice?


#2

It must be in all uppercase: $_SERVER[‘DOCUMENT_ROOT’]

si-blog
Max discount on any plan with promocode SCJESSEYTOTAL


#3

thank you.


#4

Actually, now it looks like $_SERVER[‘DOCUMENT_ROOT’] is set to:
http://myurl.com/home/myaccount/myurl.com

How do I get it to be only:
http://myurl.com

Thanks again for any advice!


#5

$_SERVER[‘DOCUMENT_ROOT’] should be set to /home/yourusername/yourdomain.com actually. You cannot change this. This topic is briefly discussed in the wiki article on allow_url_fopen.

si-blog
Max discount on any plan with promocode SCJESSEYTOTAL