needhelpplz Posted January 6, 2007 Share Posted January 6, 2007 Hello all,I need help with these error messages below.[b]Warning: require_once(adodb/adodb.inc.php) [function.require-once]: failed to open stream: No such file or directory in /home/microfix/conf/conf.main.php on line 12Fatal error: require_once() [function.require]: Failed opening required 'adodb/adodb.inc.php' (include_path='.:/usr/lib/php') in /home/microfix/conf/conf.main.php on line 12[/b]I have uploaded ADODB files onto the web server, but I still get the error. Should I put them into the public_html folder. Below is my index.php code and my conf.main.php code.[b]index.php[/b]<?php/** * This file serves as the home page for the public website * * @package Web * @subpackage Public */ob_start();session_start();/* Include configuration file */require_once('../conf/conf.main.php');/* Force browser out of SSL for non-secure pages */assertSSL(false); $page_tpl = new XiTemplate($CONFIG['paths']['templates'].'/index.tpl');configureTemplate($page_tpl, $CONFIG);require_once($CONFIG['paths']['classes'].'/class.WebPage.php');$page = new WebPage($db, $page_tpl);$page->setUrlText(getUrlText());$page->load(WebPage::URL_TEXT);if (!$page->isHome() && file_exists($CONFIG['paths']['templates'].'/inner.tpl')) $page_tpl->setTemplate($CONFIG['paths']['templates'].'/inner.tpl');$content_tpl = new XiTemplate($CONFIG['paths']['templates'].'/content.tpl');$content_tpl->multiAssign($page->getPropertiesAsArray());$content_tpl->parse('main');$page_tpl->assign('content', $content_tpl->text('main'));$page_tpl->multiAssign($page->getPropertiesAsArray());parseMenu($page_tpl, $db, 'Main Menu');$page_tpl->assign('submenu', Html::stripAttribute($submenu, 'id'));$page_tpl->parse('main.head');//require_once($CONFIG['paths']['templates'].'/template_common.php');//$page_tpl->assign('header_graphic', 'images/homepagegraphic.jpg');//$page_tpl->parse('main.header_graphic');$news = $db->execute('SELECT body_text FROM WebPages WHERE page_id = 18');$page_tpl->assign('news_text', $news->fields['body_text']);/* Send the output */$page_tpl->parse('main');$page_tpl->out('main');$dbReadOnly->close();$db->close();ob_end_flush();?>[b]conf.main.php[/b]<?php /** * This is the main website configuration file * * @package System * @subpackage Config */define('DB_USER', 'turningm');define('DB_PASS', 'mgninrut');require_once(dirname(__FILE__).'/../include/functions/site.php');require_once('adodb/adodb.inc.php');$dbReadOnly = masterConnect();$db = connect();$CONFIG = loadConfig($db);if (strstr($_SERVER['REQUEST_URI'], '~')) define('URL_MODIFIER', 1);else define('URL_MODIFIER', 0);define('URL_TARGET', 1);ini_set('include_path', ini_get('include_path').':'.$CONFIG['paths']['base']);require_once($CONFIG['paths']['classes'].'/class.System.php');require_once($CONFIG['paths']['classes'].'/class.XiTemplate.php');require_once($CONFIG['paths']['classes'].'/class.String.php');require_once($CONFIG['paths']['classes'].'/class.User.php');require_once($CONFIG['paths']['classes'].'/class.Form.php');require_once($CONFIG['paths']['classes'].'/class.Pagination.php');require_once($CONFIG['paths']['classes'].'/class.Html.php');require_once($CONFIG['paths']['classes'].'/class.EnhancedMailer.php');?> Quote Link to comment https://forums.phpfreaks.com/topic/33128-urgent-php-help/ Share on other sites More sharing options...
Mutley Posted January 6, 2007 Share Posted January 6, 2007 What directory is the "index.php" in? Quote Link to comment https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154341 Share on other sites More sharing options...
needhelpplz Posted January 6, 2007 Author Share Posted January 6, 2007 index.php is in the public_html folder Quote Link to comment https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154345 Share on other sites More sharing options...
ryld Posted January 6, 2007 Share Posted January 6, 2007 Is the path to adodb.inc.php relative to index.php or relative to conf.main.php? Quote Link to comment https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154356 Share on other sites More sharing options...
needhelpplz Posted January 6, 2007 Author Share Posted January 6, 2007 I dont understand your question, Im very new to this. I dont see where the path is. Quote Link to comment https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154361 Share on other sites More sharing options...
ryld Posted January 6, 2007 Share Posted January 6, 2007 I understand you on the newness! So am I heheWhat I mean is thisIn Index.php, you are including a file (conf.main.php) that resides in a directory different than index.php, right?Next, in conf.main.php, you are including another file (adodb.inc.php). Now, when you're including adodb.inc.php, the directory it resides in is also different from the directory of both previous files (conf.main.php and index.php). Because of the way includes work, you need to make sure that[code]require_once('adodb/adodb.inc.php');[/code]points to the file relative to index.php.What I mean is this: If index.php is in a folder called public_html, then if you preserve the code from conf.main.php, the file adodb.inc.php needs to be in the folder adodb. The folder adodb needs to be in the public_html folder. So using the code you've supplied, the file heirarchy would need to look something like this:public_html (folder)|--index.php (file in public_html)|--adodb (a folder in public_html) | --adodb.inc.php (a file in adodb)Or it could look like this for another view of it:public_html/adodb/adodb.inc.phpThat would need to be the folder setup according to your script, I believe. Someone correct me if I'm wrong.Understand? I guess it was a bit wordy and not to clear...Edited for a little more clarity. Quote Link to comment https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154369 Share on other sites More sharing options...
needhelpplz Posted January 6, 2007 Author Share Posted January 6, 2007 I put the ADODB folder into the public_html folder, so now im getting the error: [b]"Fatal error: Unable to connect to site database. in /home/microfix/include/functions/site.php on line 39"[/b]Heres Line 39 in site.php[b]if (!@$db->nconnect(EOPT_DB_HOST, EOPT_DB_USER, EOPT_DB_PASS, EOPT_DB_NAME))trigger_error('Unable to connect to site database.', E_USER_ERROR);[/b]I restored the databases, what am i doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154465 Share on other sites More sharing options...
ryld Posted January 6, 2007 Share Posted January 6, 2007 Could you paste the code that connects to the db? Including declaring the $db variable, etc...and replace the username and password with asterisks (*). Quote Link to comment https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154471 Share on other sites More sharing options...
Daniel0 Posted January 7, 2007 Share Posted January 7, 2007 You are probably using wrong login information for your MySQL server.Note: Please put your code between [nobbc][code][/code][/nobbc] tags :) Quote Link to comment https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154569 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.