tags:

views:

30

answers:

1

hi every one i'am having problem with include/require_once in PHP by which iam accessing a configuration file to connect database.

This problem exists in yahoo small business servers where i hosted my site in a free host it works fine for the same code.

the database connection is working fine but the including of files are not working even not showing an error.

Please help me out to solve this issue.

If this question is to placed on other location please lead me there.

Thanks.

<?php 
    session_start();
    require_once("classes/DbConfig.php");
    $object_db = new DB();
    $object_db->open_connection();
?>

The above is the code for accessing the DbConfig.php file which is in classes folder and the below is for creating instance of class and opening the connection which is a function in that class.

here i used include also but there is no display of any error.

i checked that if that file exists or not using the following code.

<?php
    if(file_exists("classes/DbConfig.php")) echo "File Found"; else echo "File Not Found";
?>

it displays "File Found".

And there are no error logs in the domain control panel

A: 

The file may exist however your website user (apache?) may not have the rights to read it. I would modify the script #1 to actually output something after require_once() - if it doesn't output anything you'll know that nothing gets included actually.

m1tk4