include_path query

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

include_path query

Postby mejpark » 29. March 2008 23:25

Hi XAMPP-ers,

I downloaded xampp-win32-1.6.6a.zip from SourceForge, and unpacked the archive to C:/xampp.

The include_path in C:/xampp/apache/bin/php.ini is configured like this by default:
Code: Select all
    include_path = ".;\xampp\php\pear\"


I created a script to test PEAR, and the test failed because the DB class was not found, despite the fact that the PEAR directory is specified in the include_path.

I experimented with various configurations, and finnaly managed to get it working by moving the current directory option (.) from the beginning of the string to the end:
Code: Select all
    include_path = "\xampp\php\pear\;."


So, why doesn't PEAR work when the current directory is specified first, and does work when the current directory is specified last??

Thanks!
--
mejpark
 
Posts: 8
Joined: 26. July 2007 13:57

Postby Wiedmann » 29. March 2008 23:40

I created a script to test PEAR, and the test failed

- exact error message?
- the code (line from the error messsage)?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby mejpark » 30. March 2008 11:14

Here's the pear_test.php script:

Code: Select all
<?php
require 'DB.php';
if (class_exists('DB')) {
    print "ok";
} else {
    print "failed";
}
?>


And the error:
"Fatal error: Cannot redeclare class DB in C:\xampp\php\PEAR\DB.php on line 433"

Line 433 points to the beginning of the DB class "class DB".
--
mejpark
 
Posts: 8
Joined: 26. July 2007 13:57

Postby Wiedmann » 30. March 2008 12:42

In the directory of the file "pear_test.php", you have a file with the name "db.php" (or a subdirectory "db")?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby mejpark » 30. March 2008 16:25

No, but the include_path tells PHP to look in:
Code: Select all
C:\xampp\php\pear\


Obviously, Windows is not case-sensitive, but I changed the include_path to:
Code: Select all
include_path = ".;\xampp\php\PEAR\"

and it works. What's more strange is that when I change it back to lowercase:
Code: Select all
include_path = ".;\xampp\php\pear\"

it works also?!! How weird.

Happy days
--
mejpark
 
Posts: 8
Joined: 26. July 2007 13:57


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 66 guests