enhu Posted December 18, 2008 Share Posted December 18, 2008 Warning: require_once(includes/connection.php) [function.require-once]: failed to open stream: No such file or directory in /home/.../public_html/enhu.com/index.php on line 1 Fatal error: require_once() [function.require]: Failed opening required 'includes/connection.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/.../public_html/enhu.com/index.php on line 1 how must i solve this error? Quote Link to comment https://forums.phpfreaks.com/topic/137582-fatal-error-pleeeeaaasse-help/ Share on other sites More sharing options...
rhodesa Posted December 18, 2008 Share Posted December 18, 2008 well....do you have a includes/connection.php file? if so, where is it relative to index.php? Quote Link to comment https://forums.phpfreaks.com/topic/137582-fatal-error-pleeeeaaasse-help/#findComment-719090 Share on other sites More sharing options...
Maq Posted December 18, 2008 Share Posted December 18, 2008 Show us the paths of both of these files... Quote Link to comment https://forums.phpfreaks.com/topic/137582-fatal-error-pleeeeaaasse-help/#findComment-719143 Share on other sites More sharing options...
enhu Posted December 19, 2008 Author Share Posted December 19, 2008 here's the connection.php: <?php require("constants.php"); $connection = mysql_connect(DB_SERVER,DB_USER,DB_PASS); if (!$connection) { die("Database connection failed: " . mysql_error()); } $db_select = mysql_select_db(DB_NAME,$connection); if (!$db_select) { die("Database selection failed: " . mysql_error()); } ?> and this is the index.php: <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php find_selected_page(); ?> <?php include("includes/header.php"); ?> <table width="276%" id="structure"> <tr> <td width="212" id="navigation"> <?php echo public_navigation($sel_subject, $sel_page); ?> </td> <td width="700" id="page"> <?php if ($sel_page) { ?> <h2><?php echo htmlentities($sel_page['menu_name']); ?></h2> <div class="page-content"> <?php echo strip_tags(nl2br($sel_page['content']), "<b><br><p><a>"); ?> </div> <?php } else { ?> <h2>Welcome to My Site</h2> <p> </p> <?php } ?> </td> </tr> </table> <?php include("includes/footer.php"); ?> pleeeease pleeease pleeease help. i upload the whole www folder and this is what the error said: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in /home/.../public_html/enhu.com/includes/connection.php on line 5 Database connection failed: Access denied for user 'root'@'localhost' (using password: YES) what possibly have i done? please help me fix. Quote Link to comment https://forums.phpfreaks.com/topic/137582-fatal-error-pleeeeaaasse-help/#findComment-719502 Share on other sites More sharing options...
blueman378 Posted December 19, 2008 Share Posted December 19, 2008 well the first error: cant find that file; second error: you dont have a user in your database called root with permissions. you will need to contacy your host to find the right details Quote Link to comment https://forums.phpfreaks.com/topic/137582-fatal-error-pleeeeaaasse-help/#findComment-719510 Share on other sites More sharing options...
enhu Posted December 19, 2008 Author Share Posted December 19, 2008 thanks. i think the first error is now fixed. thanx. Quote Link to comment https://forums.phpfreaks.com/topic/137582-fatal-error-pleeeeaaasse-help/#findComment-719515 Share on other sites More sharing options...
enhu Posted December 19, 2008 Author Share Posted December 19, 2008 my host dont reply so soon. i have create user in the database with my name before with all the priveledges. dyou think i'll have to create another user with the name "root"? i'm really new to this database and php thing. Quote Link to comment https://forums.phpfreaks.com/topic/137582-fatal-error-pleeeeaaasse-help/#findComment-719517 Share on other sites More sharing options...
blueman378 Posted December 19, 2008 Share Posted December 19, 2008 no you need to change the information in the constants .php it will be something like define(DB_USER, "root"); you will need to change the lines round there Quote Link to comment https://forums.phpfreaks.com/topic/137582-fatal-error-pleeeeaaasse-help/#findComment-719520 Share on other sites More sharing options...
enhu Posted December 19, 2008 Author Share Posted December 19, 2008 ok thanx. it eases me. Quote Link to comment https://forums.phpfreaks.com/topic/137582-fatal-error-pleeeeaaasse-help/#findComment-719523 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.