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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.