error including file using /dir/file.php - root is confirmed
Posted: Tue Jan 19, 2010 7:12 am
Hi everyone.
I'm having the " open_basedir restriction in effect. File(/plataform/inc/db_conn.php) is not within the allowed path(s): (/var/www/vhosts/subdomain.maindomain.com/httpdocs:/tmp) in /var/www/vhosts/subdomain.maindomain.com/httpdocs/platform/inc_general/general_configuration.php on line 22" kind of error.
I have access to the server, on a root leve. Been checking out already both httpd.include and create a vhost.conf.
On the vhost.conf I have a very httpd.include similar file but on the virtualhost (with the ip of my subdomain) I have on both IfModule sapi_apache2.c and <IfModule mod_php5.c>, and after trying to just give permission to the specific directories, php_admin_value open_basedir none.
I know I'm some what creating a security issue here but still, even with this set at none, I'm getting the same error shown above.
I restart the apache after creating the vhost file but still no use.
What is strange is I am not trying to access different domains from within. Let me explain this better. I have had this kind of issue when trying to upload a file from http://www.domain1.com to http://www.domain2.com (they were set at the same server).
But here I'm just trying to use a prepend file on htaccess and on that file I have a constant with the root of the site, that should be /plataform/.
When trying to include the db_con file, using ROOT_PATH . "/inc/db_con.php" I get the error.
Any tips, you guys?
Thank you very much for your help and attention
[ EDITED ]
I've managed to change the vhost and the file is getting include. However, all the files I include using include('/dir/file.php') output the "failed to open stream: No such file or directory in" error.
I am sure the files are there as I can see them on the server. I don't know what is wrong since I've tried as well echoing the
$_SERVER['DOCUMENT_ROOT']; and the root is /var/www/vhosts/subdomain.maindomain.com/httpdocs, which is the real root of my site.
The folders and files are there, but they don't get included.
Any tips?
Ricardo
I'm having the " open_basedir restriction in effect. File(/plataform/inc/db_conn.php) is not within the allowed path(s): (/var/www/vhosts/subdomain.maindomain.com/httpdocs:/tmp) in /var/www/vhosts/subdomain.maindomain.com/httpdocs/platform/inc_general/general_configuration.php on line 22" kind of error.
I have access to the server, on a root leve. Been checking out already both httpd.include and create a vhost.conf.
On the vhost.conf I have a very httpd.include similar file but on the virtualhost (with the ip of my subdomain) I have on both IfModule sapi_apache2.c and <IfModule mod_php5.c>, and after trying to just give permission to the specific directories, php_admin_value open_basedir none.
I know I'm some what creating a security issue here but still, even with this set at none, I'm getting the same error shown above.
I restart the apache after creating the vhost file but still no use.
What is strange is I am not trying to access different domains from within. Let me explain this better. I have had this kind of issue when trying to upload a file from http://www.domain1.com to http://www.domain2.com (they were set at the same server).
But here I'm just trying to use a prepend file on htaccess and on that file I have a constant with the root of the site, that should be /plataform/.
When trying to include the db_con file, using ROOT_PATH . "/inc/db_con.php" I get the error.
Any tips, you guys?
Thank you very much for your help and attention
[ EDITED ]
I've managed to change the vhost and the file is getting include. However, all the files I include using include('/dir/file.php') output the "failed to open stream: No such file or directory in" error.
I am sure the files are there as I can see them on the server. I don't know what is wrong since I've tried as well echoing the
$_SERVER['DOCUMENT_ROOT']; and the root is /var/www/vhosts/subdomain.maindomain.com/httpdocs, which is the real root of my site.
The folders and files are there, but they don't get included.
Any tips?
Ricardo