Jump to content

Includes and Requires dont seem to be working? Is it my code?


jordz

Recommended Posts

Okay so my directory is structured like this

 

/beta/ contains config.php among other files.

 

Every time I require or include it I get an error corresponding to this:

 

Warning: require_once(/config.php) [function.require-once]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/beta/dbeditor/index.php on line 5

 

Fatal error: require_once() [function.require]: Failed opening required '/config.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/beta/dbeditor/index.php on line 5

 

I've tried modify my code like so:

require('config.php');
require('./config.php');
require('/config.php');

 

still nothing, Ive looked around the web and can't find anywhere that explains this enough for me to understand let alone how to fix it.

The current directory im working in is /beta/dbeditor/ anyway but nothing in /beta works either.

 

Please, any help would be greatly appreciated.

 

Jordan

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.