By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,990 Members | 1,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,990 IT Pros & Developers. It's quick & easy.

Fatal error: require_once() [function.require]: Failed opening required

P: n/a
i have a program in webserver. i run smooth before. but dunno why it sudden prompt out the error below?

Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/var/www/vhosts/ is not within the allowed path(s): (/var/www/vhosts/ in /var/www/vhosts/ on line 11

Warning: require_once(/var/www/vhosts/ [function.require-once]: failed to open stream: Operation not permitted in /var/www/vhosts/ on line 11

Fatal error: require_once() [function.require]: Failed opening required '/var/www/vhosts/' (include_path='.:') in /var/www/vhosts/ on line 11

please help...
Oct 25 '10 #1
Share this Question
Share on Google+
1 Reply

P: 2
Hi Kinhoe,

I too have the same problem. Here is the error I get and the code causing it.

Warning: require_once(Company.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/33/3497533/html/lib/config.php on line 134

Fatal error: require_once() [function.require]: Failed opening required 'Company.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/33/3497533/html/lib/config.php on line 134

This is the routine in config.php

* Instance the main database connection.
$GLOBALS['tax_mdb2'] = new PDO("mysql:host=".$db_host.";dbname=".$db_name, $db_user, $db_pass);
$conn=mysql_connect($db_host,$db_user,$db_pass) or die("Failed to Connect with Database.");
$out=mysql_select_db($db_name,$conn) or die(mysql_error($conn));

* PHP 5 magic function - to load automaticaly classes. The file, that contain the
* requested class, must be named in the same way as the class itself.
* @param string $className
function __autoload($className){

require_once $className.'.php';

At this point, I kinda stuck - if anyone has an answer, that would help.

Oct 25 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.