PEAR / include path
| From: | zaphod at s4r dot de | Date: | Fri, 04 Oct 2002 20:46:15 +0000 |
| Subject: | PEAR / include path | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-2434@lists.php.net to get a copy of this message | ||
[This followup was posted to php.pear.general and a copy was sent to the
cited author.]
Hi,
I am currently starting to use PEAR and wonder a little bit about how
the directories ar set up.
In the PHP.INI my include path looks like this:
include_path = ".;C:\PHPLIB"
Then I dropped the PEAR-folder into C:\PHPLIB. So now you find PEAR.php
under C:\PHPLIB\PEAR\PEAR.php.
Then I started to write my first script:
<head>
<title>Test</title>
</head>
<body>
<?php
require_once('PEAR/PEAR.php');
require_once('PEAR/System.php');
echo "Hello\n";
?>
</body>
</html>
This gives me an error saying:
Fatal error: Failed opening required 'PEAR.php' (include_path='.;C:
\PHPLIB') in C:\PHPLIB\PEAR\Console\Getopt.php on line 21
To solve the problem I have to put the PEAR-Folder in the include_path
of my php.ini.
I really wonder, why PEAR is designed in a way, that a file in a
subfolder expects PEAR.php there and not on PEAR/PEAR.php.
When I look into the PEAR-folder I find files with names as simple as
that: DB.php. This means, I cannot install another library which itself
also has a file called DB.php and put it in the include_path of my
php.ini because then I have to wonder which file will be included.
I would recommend to change the directory-structure of PEAR to avoid
this problem.
Regards
Thomas