Jump to content

<?php include($_SERVER['DOCUMENT_ROOT'


mihomes

Recommended Posts

Here is the deal... I just switched all my websites to a new server and they are all on the same IP address whereas before each site had its own IP.

I make a call such as <?php include($_SERVER['DOCUMENT_ROOT']."/document.php");?>

What I expect from this is it will look at www.example.com/document.php as it always did before.  Instead it looks for the 'document.php' file from the first account on the IP.

Warning: main(/home/absolute/public_html/document.php): failed to open stream: No such file or directory in

/home/network/public_html/index.html on line 1

Warning: main(): Failed opening '/home/absolute/public_html/document.php' for inclusion

(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/network/public_html/index.html on line 1

So in this case it should look for the file in the account network, but instead looks for it in the account absolute as all the domains are on the same IP now.  How in the world can I fix this?

I cannot change the code to <?php include($_DOCUMENT_ROOT."document.php");?> as if the call is made in a higher directory then the root it looks in the wrong location.
Link to comment
https://forums.phpfreaks.com/topic/17683--/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.