patsfans Posted November 13, 2012 Share Posted November 13, 2012 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 More sharing options...
JeanPierre Posted November 14, 2012 Share Posted November 14, 2012 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")); ?> Link to comment https://forums.phpfreaks.com/topic/270643-issue-with-php-include-on-subdomain/#findComment-1392287 Share on other sites More sharing options...
requinix Posted November 14, 2012 Share Posted November 14, 2012 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. Link to comment https://forums.phpfreaks.com/topic/270643-issue-with-php-include-on-subdomain/#findComment-1392416 Share on other sites More sharing options...
Scott_S Posted November 14, 2012 Share Posted November 14, 2012 Permissions possibly but I suspect your inclusion is outside of your sub domains root directory (not DOCUMENT ROOT). Have a look at your file structure. Link to comment https://forums.phpfreaks.com/topic/270643-issue-with-php-include-on-subdomain/#findComment-1392422 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.