Jump to content

Recommended Posts

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 12

Fatal 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');
?>

Link to comment
https://forums.phpfreaks.com/topic/33128-urgent-php-help/
Share on other sites

I understand you on the newness!  So am I hehe

What I mean is this

In 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.php

That 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.
Link to comment
https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154369
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/33128-urgent-php-help/#findComment-154465
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.