Cant Find Documents?


#1

Alright, I am working on a script that requires a series of PHP documents to be read in order to create the page with a lot of statements (if/else/else if) and more. But before I can even test this I get straight errors. I am getting require errors. I have checked that all the files are there, but when uploading to my server, it doesnt work.

For Example, Here I have my config.php:

<?php

// Lets Gather our Database Details in order to Connect and store data.
require('../sources/dbconnect.php');

// Select our theme and import editting features.
require('../style/templates/selection.php');

// Do we want our security question to be displayed when posting?
require('../sources/recaptcha.php');

// We need our settings to be displayed on the page. 
require('../sources/settings.php');

// Get our style settings (logo and such)
require('../sources/stylesettings.php');

// Require our [iferrors], cant forget those.
require('../sources/errors.php');

// Check we have installed our pastie. 
require('../sources/install.php');

// Get our apps ready/set up.
require('../classes/apps.php');

// Build our template and page layout
require('../styles/templates/'.$CONF['theme'].'/templates.php');

// We would include init-data.php but we dont want
// errors on every page if there is something messed 
// up, so we are going to manually put them into certain 
// pages, whichever needs/doesnt need them. :)

?>

But then I get this error straight away:

Warning: require(../sources/dbconnect.php) [function.require]: failed to open stream: No such file or directory in /home/u527924784/public_html/config.php on line 10

Fatal error: require() [function.require]: Failed opening required '../sources/dbconnect.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/u527924784/public_html/config.php on line 10

But when I visit my url (http://mydomain.com/sources/dbconnect.php) Its there, and works fine, and I cant seem to figure out what the problems are. Any help, also if anyone could help to my numeric ordering create PHP question, that would help too. Link: http://www.phphelp.com/forum/index.php?topic=15975.0

Thanks!


#2

Need to look at the folder structure in relation to where that file is, because it automatically sets the base folder as that.

So if you’re starting domain.com/themes/times/index.php, then its going to assume that your base url is that. what your doing is telling it to back up 1 folder to domain.com/themes/sources. So try just removing the …/ from behind the folder reference.