Difficulty understanding unix file names?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Difficulty understanding unix file names?

Postby tryin_to_learn » 25. May 2009 14:12

Hi,

I've been a happy XAMPP user for several years. I recently had to do a system restore so I downloaded the latest version of XAMPP and am now finding that when I do something in the site I'm working on that triggers a call to the database, I'm getting this error message:

<b>Warning</b>: require_once(M_LIB_PATHDB.core.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>4</b><br />

<b>Fatal error</b>: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'M_LIB_PATHDB.core.php' (include_path='.;C:\xampp\php\pear\') in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>4</b>


I'm the designer so I don't understand the backend stuff well but I checked with the developer and after having me try several things - which all produced the same error - he said that it looked like a problem reading unix file names. Everything was working fine with my older version of XAMPP. Any ideas about what I need to do to fix this? Or is there a way to revert to a previous version? I read something about being able to revert to PHP4 - I can't use that because I need PHP5 but I think my previous version used 5.1 whereas this one uses 5.2. I'm not sure if that's where the problem is or not. Help?
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Difficulty understanding unix file names?

Postby Wiedmann » 25. May 2009 14:20

<b>Warning</b>: require_once(M_LIB_PATHDB.core.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>4</b><br />

I guess you are using a constant (M_LIB_PATHDB) in a wrong way.

(can't say more without knowing how this line 4 looks like.)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Difficulty understanding unix file names?

Postby tryin_to_learn » 25. May 2009 15:24

I'm not sure what all you need but here's some additional info - let me know if you need more:

The line 4 you're referring to is in init.php. It's actually line 3 in the code below - I had put an echo line in line 3 to make sure it was finding the correct path at the time I copied the error message. But it's the require_once (M_LIB_PATH.'DB.core.php'); on line 3 below that's causing the problem. Here's the whole init.php file:

Code: Select all
<?php
require_once ('config.php');
require_once (M_LIB_PATH.'DB.core.php');
require_once (M_LIB_PATH.'App.class.php');
require_once (M_LIB_PATH.'User/USession.class.php');
require_once (M_LIB_PATH.'DB/Person.class.php');

//must be defined in config.php
if (!defined('SESSION_START_ON_LOGIN'))define('SESSION_START_ON_LOGIN',true);
if (!defined('SESSION_TIME_OUT'))define('SESSION_TIME_OUT',10800);
if (!defined('SESSION_VERIFY_IP'))define('SESSION_VERIFY_IP',true);

DB::connect();
$APP=new App ();
$GLOBAL_NAV=array('clients'=>'Clients/Sessions/Payments','libraries'=>'Libraries','calendar'=>'Calendar','reports'=>'Reports/Statements/HCFA');

$USESSION=new USession($CONFIG['SESSION_NAME'],$CONFIG['SESSION_LONG_SEC']);
if (!$USESSION->sessionID and !defined('BYPASS_IDENTIFICATION')) {
   if (!defined('DISABLE_AUTO_LOGIN')) {
   $APP->redirect('login.php');
    exit;
   } else {
    header("Status: 403 Forbidden");
   echo 'Access denied';
   exit;   
   }
}
$USER=new Person($USESSION->userID);

$PAGE['JSSRC'][]='jslibs/dhtml.js';
$PAGE['CSS'][]='_styles/dhtml.css';
$PAGE['CSS'][]='_styles/forms.css';
?>


You may also want the corresponding lines from config.php:

The original way we had it was:

Code: Select all
define ('A_SITE_PATH',dirname(__FILE__).'/');
define ('M_LIB_PATH',A_SITE_PATH.'libs/');
define ('TEMPLATES_PATH',A_SITE_PATH.'_templates/');
define ('BASE_URL','/__shrinkOffice/');


We've tried working with the A_SITE_PATH variable - have tried these things - this first one produces the same error as above, i.e., the errors occur when you use one of the tools that accesses the database:

Code: Select all
define ('A_SITE_PATH','/xampp/htdocs/__shrinkOffice/');


These last two we tried cause the whole site to fail to load:

Code: Select all
define ('A_SITE_PATH','__shrinkOffice/');


Error messages for this one were:

Warning: require_once(__shrinkOffice/libs/DB.core.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\__shrinkOffice\init.php on line 3

Fatal error: require_once() [function.require]: Failed opening required '__shrinkOffice/libs/DB.core.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\__shrinkOffice\init.php on line 3



And this attempt also caused the site to fail to load with similar error messages:

Code: Select all
define ('A_SITE_PATH','localhost/__shrinkOffice/');


Errors:

Warning: require_once(localhost/__shrinkOffice/libs/DB.core.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\__shrinkOffice\init.php on line 3

Fatal error: require_once() [function.require]: Failed opening required 'localhost/__shrinkOffice/libs/DB.core.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\__shrinkOffice\init.php on line 3
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Difficulty understanding unix file names?

Postby Wiedmann » 25. May 2009 16:50

<b>Warning</b>: require_once(M_LIB_PATHDB.core.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>4</b><br />
Code: Select all
require_once ('config.php');
require_once (M_LIB_PATH.'DB.core.php');

Code: Select all
define ('A_SITE_PATH',dirname(__FILE__).'/');
define ('M_LIB_PATH',A_SITE_PATH.'libs/');

Assuming the file "DB.core.php" is in the directory "C:\xampp\htdocs\__shrinkOffice\libs", and the files "init.php" and "config.php" are in "C:\xampp\htdocs\__shrinkOffice", and you requesting the file with "http://localhost/__shrinkOffice/init.php", this should work. (regarding the above error message)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Difficulty understanding unix file names?

Postby tryin_to_learn » 25. May 2009 17:23

The files are in the correct places - that was my first thought, too. Everything was working fine before I had to reinstall. The first time I put in the echo line in the init file (echo M_LIB_PATH.'DB.core.php';) I got a weird result:

C:\xampp\htdocs\__shrinkOffice/libs/DB.core.php


Today, however, the echo line seems to be returning what I would expect except that it still throws the same error message. Here's the result of the echo today:

/xampp/htdocs/__shrinkOffice/libs/DB.core.php
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Difficulty understanding unix file names?

Postby Wiedmann » 25. May 2009 17:34

echo M_LIB_PATH.'DB.core.php'; ... I got a weird result:
C:\xampp\htdocs\__shrinkOffice/libs/DB.core.php

Why is this weired? There should be no error message with:
Code: Select all
require M_LIB_PATH.'DB.core.php';

If the file "DB.core.php" is in the directory "C:\xampp\htdocs\__shrinkOffice\libs".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Difficulty understanding unix file names?

Postby tryin_to_learn » 25. May 2009 17:48

That's my ignorance speaking then. I thought maybe the mixture of forward slashes and backward slashes were wrong. DB.core.php" is in the directory "C:\xampp\htdocs\__shrinkOffice\libs - that was the first thing I checked and I checked it again just now to make sure I hadn't looked at it wrong. I even tried recloning the site a couple of times in case DB.core.php - or some other file - hadn't downloaded correctly.

Any other ideas about what I might try?
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Difficulty understanding unix file names?

Postby Wiedmann » 25. May 2009 17:52

Any other ideas about what I might try?

Just a question...

With this configuration:
Code: Select all
define ('A_SITE_PATH',dirname(__FILE__).'/');
define ('M_LIB_PATH',A_SITE_PATH.'libs/');


You have really this error message:
<b>Warning</b>: require_once(M_LIB_PATHDB.core.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>4</b><br />

(I don't think so)

Or only a similar/other error message?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Difficulty understanding unix file names?

Postby tryin_to_learn » 25. May 2009 17:58

I copied your code exactly to make sure I wasn't misspelling anything. Here's the error:

<br />
<b>Warning</b>: require_once(M_LIB_PATHDB.core.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>3</b><br />
<br />
<b>Fatal error</b>: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'M_LIB_PATHDB.core.php' (include_path='.;C:\xampp\php\pear\') in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>3</b><br />

tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Difficulty understanding unix file names?

Postby Wiedmann » 25. May 2009 18:07

<b>Warning</b>: require_once(M_LIB_PATHDB.core.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>3</b><br />

In your last post, this was in line 4 not 3?

Sure you also have exactly:
Code: Select all
require_once (M_LIB_PATH.'DB.core.php');
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Difficulty understanding unix file names?

Postby tryin_to_learn » 25. May 2009 18:20

Yes - I copied your require_once (M_LIB_PATH.'DB.core.php'); exactly to make sure and I still get the same error. The line 3 is correct. The line 4 was from when I had put an echo line in line 3 earlier which altered the error message. But it's always referred to the M_LIB_PATH.'DB.core.php path.
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Difficulty understanding unix file names?

Postby Wiedmann » 25. May 2009 18:27

But it's always referred to the M_LIB_PATH.'DB.core.php path.

That's the curios thing. In your error message it's not referring to "M_LIB_PATH.'DB.core.php'".

It's referring to "M_LIB_PATHDB.core.php". This can only happens, if M_LIB_PATH is not defined.

But if "echo M_LIB_PATH;" (one line before this require) outputs some path... I don't know what happens.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Difficulty understanding unix file names?

Postby tryin_to_learn » 25. May 2009 19:07

Ok, yes, when I put in echo M_LIB_PATH; I get C:\xampp\htdocs\__shrinkOffice/libs/

I had thought the same thing, though - that the problem is that we're seeing M_LIB_PATHDB.core.php in the error message, i.e., without the / separating M_LIB_PATH and DB.core.php. But when I echo it, the forward slash is there.
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Difficulty understanding unix file names?

Postby Wiedmann » 25. May 2009 19:16

i.e., without the / separating M_LIB_PATH and DB.core.php.

The missing "/" is not the problem. The problem is, that you can see the word "M_LIB_PATH". Because if this a defined constant, there is no way to see this word. (if you are using the code above)

Ok, yes, when I put in echo M_LIB_PATH; I get C:\xampp\htdocs\__shrinkOffice/libs/

And you have this echo() in the file "init.php"?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Difficulty understanding unix file names?

Postby tryin_to_learn » 25. May 2009 19:22

Oh, ok. I see what you're saying. Yes. The first 7 lines of init.php are now:
Code: Select all
<?php
require_once ('config.php');
echo M_LIB_PATH;
require_once (M_LIB_PATH.'DB.core.php');
require_once (M_LIB_PATH.'App.class.php');
require_once (M_LIB_PATH.'User/USession.class.php');
require_once (M_LIB_PATH.'DB/Person.class.php');


And the error message is:
M_LIB_PATH<br />
<b>Warning</b>: require_once(M_LIB_PATHDB.core.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>4</b><br />
<br />
<b>Fatal error</b>: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'M_LIB_PATHDB.core.php' (include_path='.;C:\xampp\php\pear\') in <b>C:\xampp\htdocs\__shrinkOffice\init.php</b> on line <b>4</b><br />
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 96 guests