N8Webs
08-11-2005, 11:07 PM
I am forced to move to a new hosting account and am having problems with some php coding.
The original coding is:
<?php
$thefile = "/home/username/domains/domainname.com/public_html/$page.shtml";
if (file_exists($thefile))
{
include("$thefile");
}
else
{
include("/home/username/domains/domainname.com/public_html/default.shtml");
}
?>
The new hosting company allows me to have multiple domains, however it puts each domain in a unique root folder
<?php
$thefile = "/home/httpd/vhosts/domain.com/httpdocs/$page.shtml";
if (file_exists($thefile))
{
include("$thefile");
}
else
{
include("/home/httpd/vhosts/domain.com/httpdocs/default.shtml");
}
?>
The beauty was with server #1 I had several domains under a similar root path and thus could have several web sites that point to one common /public_html/ folder.
With server #2, when I setup the code I get the following error:
main(): open_basedir restriction in effect. File(/home/httpd/vhosts/domain2/httpdocs/default.shtml) is not within the allowed path(s): (/home/httpd/vhosts/domain1/httpdocs:/tmp) in /home/httpd/vhosts/domain1/httpdocs/index2.php on line 37
Any thoughts?
Thanks,
Michael
The original coding is:
<?php
$thefile = "/home/username/domains/domainname.com/public_html/$page.shtml";
if (file_exists($thefile))
{
include("$thefile");
}
else
{
include("/home/username/domains/domainname.com/public_html/default.shtml");
}
?>
The new hosting company allows me to have multiple domains, however it puts each domain in a unique root folder
<?php
$thefile = "/home/httpd/vhosts/domain.com/httpdocs/$page.shtml";
if (file_exists($thefile))
{
include("$thefile");
}
else
{
include("/home/httpd/vhosts/domain.com/httpdocs/default.shtml");
}
?>
The beauty was with server #1 I had several domains under a similar root path and thus could have several web sites that point to one common /public_html/ folder.
With server #2, when I setup the code I get the following error:
main(): open_basedir restriction in effect. File(/home/httpd/vhosts/domain2/httpdocs/default.shtml) is not within the allowed path(s): (/home/httpd/vhosts/domain1/httpdocs:/tmp) in /home/httpd/vhosts/domain1/httpdocs/index2.php on line 37
Any thoughts?
Thanks,
Michael
