File not found localhost website (xampp)

Hi,


I am getting this error on my localhost website...


Warning: require_once(/xamppfiles/htdocs/includes/cljsdb.inc.php) [function.require-once]: failed to open stream: No such file or directory in/Applications/XAMPP/xamppfiles/htdocs/includes/initialise.phpon line 19


Fatal error: require_once() [function.require]: Failed opening required '/xamppfiles/htdocs/includes/cljsdb.inc.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xam ppfiles/lib/php/pear') in/Applications/XAMPP/xamppfiles/htdocs/includes/initialise.phpon line 19


I am sure the file is there...here is the code it is complaining about...it reports an error on the last line, but as I say, cljsdb.inc.php is present in that folder.


I'm not sure what anyone can do to help...either the file is there or it isn't...but as this is my first time with xampp on mac maybe I'm missing something obvious...wouldn't be the first time.


Cheers,


Col

MacBook Pro, Mac OS X (10.5)

Posted on Jul 26, 2012 2:36 AM

Reply
5 replies

Jul 26, 2012 4:38 AM in response to colinspurs

if you're sure the file is where you think it is (and I put that in bold because you have no idea how many times I've helped people who were so sure a file was there that they didn't bother to look), then something's going wrong with the path construction you're doing. have you put in a debugger statement just before the require once? something like var_dump(LIB_PATH.DS.'cljsdb.inc.php'); - that should print out the path it's trying to include so you can check that it's building the string correctly.


If the path is correct and the file is there, it may be a permissions issue. I don't remember if php is smart enough to distinguish between a file it can't find and a file it can't open.

Jul 26, 2012 2:39 AM in response to colinspurs

Forgot to post the code...I need a coffee...


<?php



// Define the core paths

// Define them as absolute paths to make sure that require_once works as expected



// DIRECTORY_SEPARATOR is a PHP pre-defined constant

// (\ for Windows, / for Unix)

defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);



defined('SITE_ROOT') ? null : define('SITE_ROOT', DS.'xampp'.DS.'htdocs');



defined('CLASS_PATH') ? null : define('CLASS_PATH', SITE_ROOT.DS.'classes');



defined('LIB_PATH') ? null : define('LIB_PATH', SITE_ROOT.DS.'includes');



defined('HTML_PATH') ? null : define('HTML_PATH', SITE_ROOT.DS.'layouts');



// load config file first

require_once(LIB_PATH.DS.'cljsdb.inc.php');

Jul 26, 2012 5:25 AM in response to twtwtw

Many thanks. You pointed me to the cause, which was in fact an incorrect setting of the site root. A difference between Windows and Lion which I should have seen.


I need a few "One to Ones" on the Mac file structure obviously.


For example, when I copied my files across from my PC to Applications/XAMPP/htdocs, it created them also in .../xamppfiles. One folder is an alias of the other?


Cheers,


Colin

Jul 26, 2012 5:48 AM in response to colinspurs

A quick glance at the docs - (Mac) (WIndows) - shows that the installation methods are entirely different. Windows had an installer that puts components into the system, while Mac has a self-enclosed application. Obviously unix and windows have different low-level system directory structures, but I suspect that the application merely redirects the system to use its own internal php.ini file and folder structure. You may be over-engineering: packages like this on the Mac are often designed to be opaque with high-level access points, so that it's easier and quicker to get things up and running. You'll have to check with the XAMMP people to get the details.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

File not found localhost website (xampp)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.