I'm trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided.
The website cannot find PEAR, and throws the below errors:
Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampplite\htdocs\laconica\lib\common.php on line 31
Fatal error: require_once() [function.require]: Failed opening required 'PEAR.php' (include_path='.;\xampplite\php\pear\PEAR') in C:\xampplite\htdocs\laconica\lib\common.php on line 31
- PEAR is located in
C:\xampplite\php\pear
phpinfo()
shows me that the include path is.;\xampplite\php\pear
What am I doing wrong? Why isn't the PEAR folder being included?
I tried all of the other answers first but none of them seemed to work so I set the pear path statically in the pear config file
C:\xampp\php\pear\Config.php
find this code:
and just replace it with this:
I restarted apache and used the command:
make sure the all of the paths no longer start with C:\php\pear
Another gotcha for this kind of problem: avoid running pear within a Unix shell (e.g., Git Bash or Cygwin) on a Windows machine. I had the same problem and the path fix suggested above didn't help. Switched over to a Windows shell, and the pear command works as expected.
AS per point 1, your PEAR path is c:\xampplite\php\pear\
However, your path is pointing to \xampplite\php\pear\PEAR
Putting the two one above the other you can clearly see one is too long:
c:\xampplite\php\pear\
\xampplite\php\pear\PEAR
Your include path is set to go one PEAR too deep into the pear tree. The PEAR subfolder of the pear folder includes the PEAR component. You need to adjust your include path up one level.
(you don't need the c: by the way, your path is fine as is, just too deep)
If you are using the portable XAMPP installation and Windows 7, and, like me have the version after they removed the XAMPP shell from the control panel none of the suggested answers here will do you much good as the packages will not install.
The problem is with the config file. I found the correct settings after a lot of trial and error.
Simply pull up a command window in the \xampp\php directory and run
you will want to replace the ':' with the actual drive letter that your portable drive is running on at the moment. Unfortunately, this needs to be done any time this drive letter changes, but it did get the module I needed installed.
You need to fix your
include_path
system variable to point to the correct location.To fix it edit the
php.ini
file. In that file you will find a line that says, "include_path = ...
". (You can find out what the location of php.ini by runningphpinfo()
on a page.) Fix the part of the line that says, "\xampplite\php\pear\PEAR
" to read "C:\xampplite\php\pear
". Make sure to leave the semi-colons before and/or after the line in place.Restart PHP and you should be good to go. To restart PHP in IIS you can restart the application pool assigned to your site or, better yet, restart IIS all together.
On Windows use the Xampp shell (there is a 'Shell' button in your XAMPP control panel)
then
to go to 'C:\xampp\php\pear'
then type