Jump to content

Issue With Php Include On Subdomain


patsfans

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.

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.