Hello. Right now I am trying to set up a mail server, and I am having a heck of a time with this file. I did not write this, and I am completely baffled by this line of code.
require_once("config.inc.php");
This file does not exist in the directory, and when I check a working version of the program, it does not exist in the directory as well. Where else could require_once be pulling information from? A PHP extension I am not aware of? I am guessing it is related to pear but I really do not understand the libraries.
This is the error code it spits out
Warning: require_once(config.inc.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/html/******/********/index.php on line 25
Fatal error: require_once() [function.require]: Failed opening required 'config.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/******/********/index.php on line 25
Strange require_once(config.inc.php)
Moderator: General Moderators
-
cjswanson1355
- Forum Newbie
- Posts: 10
- Joined: Wed Nov 05, 2008 3:13 pm
Strange require_once(config.inc.php)
Last edited by cjswanson1355 on Wed Feb 04, 2009 3:01 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Strange require_once(config.inc.php)
PHP has something called an include path, where you can predefine the directories where PHP should attempt to load the file from, i.e. PEAR.
Take a look at
Take a look at
Code: Select all
echo get_include_path();Re: Strange require_once(config.inc.php)
Can you post the code above that line please? Also, is this file included by a different file? For example:
index.php
config.inc.php
/includes/somefile.php
If you request index.php, the current directory is / (for the purposes of this example). Now if index.php includes includes/somefile.php, this does not change the current working directory. somefile.php could then include config.inc.php without error.
index.php
config.inc.php
/includes/somefile.php
If you request index.php, the current directory is / (for the purposes of this example). Now if index.php includes includes/somefile.php, this does not change the current working directory. somefile.php could then include config.inc.php without error.
-
cjswanson1355
- Forum Newbie
- Posts: 10
- Joined: Wed Nov 05, 2008 3:13 pm
Re: Strange require_once(config.inc.php)
The only code above that line is some documentation. and the start php header. This is pulling from a different file.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Strange require_once(config.inc.php)
You didn't address my response to the include path, nor to whether the file is being included from another page. 
-
cjswanson1355
- Forum Newbie
- Posts: 10
- Joined: Wed Nov 05, 2008 3:13 pm
Re: Strange require_once(config.inc.php)
So after echoing the include path i get
/usr/share/pear:/usr/share/php'
Am I correct in assuming I need to create this directly and get the config file from my admin and put in in there.
/usr/share/pear:/usr/share/php'
Am I correct in assuming I need to create this directly and get the config file from my admin and put in in there.
-
cjswanson1355
- Forum Newbie
- Posts: 10
- Joined: Wed Nov 05, 2008 3:13 pm
Re: Strange require_once(config.inc.php)
n/m, I found out i need to access the webpage through a region.