Jump to content

Recommended Posts

I'm trying to include the following on a page on a subdomain, which is on the same server as the parent domain:

 

<? include ("/home/httpd/vhosts/mydomain.com/httpdocs/file.php"); ?>

 

Unfortunately the file doesn't open/execute, and the error I get when I check the error log is "Failed opening '/home/httpd/vhosts/mydomain.com/httpdocs/file.php' for inclusion".

 

Again, since it's on a subdomain I'm just wondering if there's a permission issue or if there's something else that needs to be done that I'm just missing?

Link to comment
https://forums.phpfreaks.com/topic/270643-issue-with-php-include-on-subdomain/
Share on other sites

When the file.php is callable via http you can simple solve it by adding:

 

<?php echo implode(file("http://www.yourdomain.com/file.php")); ?>

Not the same thing. OP seems to want to include PHP code while yours will output whatever the script outputs.

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.