Incorrect PEAR directories - C:\php5

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

Incorrect PEAR directories - C:\php5

Postby sylsft » 04. February 2008 21:58

Hi all,

Can anyone tell me why XAMPP's PEAR has a few directories (doc_dir, cache_dir, etc.) hard-coded to C:\php5 instead of the directory you actually installed XAMPP to?

Is this a known bug? If not, where should it be reported?

Thanks,
Jason.
sylsft
 
Posts: 2
Joined: 04. February 2008 21:51

Postby Izzy » 05. February 2008 00:40

Not a bug but a possible XAMPP installation error or another instance of PHP on your system.

This thread may hold some clues for you as the end result was another instance of PHP that the poster had not realized was on his PC:
http://community.apachefriends.org/f/viewtopic.php?t=27859
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby sylsft » 05. February 2008 01:15

Izzy wrote:Not a bug but a possible XAMPP installation error or another instance of PHP on your system.


In this case, it is a brand new Dell system that has never had any LAMP stuff installed previously.
sylsft
 
Posts: 2
Joined: 04. February 2008 21:51

Re: Incorrect PEAR directories - C:\php5

Postby Izzy » 05. February 2008 09:13

sylsft wrote:...Can anyone tell me why XAMPP's PEAR has a few directories (doc_dir, cache_dir, etc.) hard-coded to C:\php5 instead of the directory you actually installed XAMPP to?...
No where, in any file or directory of my properly installed and working installation of XAMPP, or for that matter in any other installation of XAMPP I have ever installed is anything hard coded with C:\php5 - so I repeat, this is not a bug - if installed correctly, following the very simple installation instructions, XAMPP will run "out of the box" as this is how it has been developed to perform.

BTW, I used His Grepship to search every single file in my C:\xampp directory for C:\php5 but it came up with only one reference in a shebang line #!C:\php5/php in a file called pecl-gen C:\xampp\php\pecl-gen which is not related to your issue and is not hard coded by the XAMPP developers but is a PECL (PHP Extension Community Library) file.

sylsft wrote:...that has never had any LAMP stuff installed previously.

This means nothing to me as PHP can be included in may program installation other than a WAMP installation.
BTW, LAMP = Linux Apache MySQL PHP - I assume you are talking about a Windows installation of XAMPP here?

Did you follow the installation instruction with regard to running .\xampp\setup_xampp.bat if needed, immediately after installation was complete?

Did you run the .\xampp\xampp-portcheck.exe file, before starting any of the XAMPP modules, to make sure that all ports are Free?

Is this C:\php5 path contained within your Windows Local or System Environment Variables?

What OS and version?

Which version of XAMPP?

Where did you install XAMPP to?

What error messages are you seeing that contains this errant path?

Is this C:\php5 path anywhere to be found in your XAMPP installation's php ini file?:
.\xampp\apache\bin\php.ini
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Clarifications

Postby DesiredUsername » 05. February 2008 15:48

To properly respond to your post, I should first indicate that I am, in fact, the person who set up XAMPP on the computer in question.

The version of XAMPP installed is the most recent one, 1.6.5 It was installed on a Dell Laptop running Windows XP Professional, SP2.

No, setup-xampp.bat was not run. I was under the impression that this was not needed, since I used the installer.

At the end of the installation, the XAMPP control panel started. I started Apache and MySQL without incident, and was able to access the default page that comes with XAMPP. I was also able to access the security directory.

No, I did not run xampp-portcheck.exe Since I was able to access the webpage at 127.0.0.1 and there were no errors, I assumed that everything was already configured correctly.

XAMPP was installed to C:\Program Files\xampp. Yes, I know that this is not the recommended location, but I still don't think it is the cause of the problem.

No, I have not found C:\php5 in any of the Local or System Environment Variable paths. It is also not found in php.ini in the apache directory.

(Missed this one on the first time through) As far as I know, there were no previous versions of PHP on the computer. Seeing as how it was jsut bought recently, it would have needed to be installed already when purchased. I don't think Windows comes with PHP.

I discovered this while typing in the command pear config-show in a command prompt at the xampp directory. There were about three paths which used C:\php5. I changed them to what they should be by using pear config-set. This may have removed the traces of the problem.

The following site also reports the problem http://trac.symfony-project.com/wiki/BeginningSymfonyWithPear. They ran xampp-setup.bat, and had it installed in C:\xampp. So I have to conclude that there is something else which is a problem, besides where I set it up or how I did so.
DesiredUsername
 
Posts: 1
Joined: 05. February 2008 15:22

Re: Clarifications

Postby Izzy » 06. February 2008 10:51

I had some free time today to try and see if I could replicate this C:\php5 issue on my XAMPP installation which, because of a mod_perl issue in Apache 2.2.6 in the latest XAMPP 1.6.5, I still have XAMPP version 1.6.3a but it did not make any difference to my replication attempt.

This line in the pear.bat file gave a clue:
:: Check PEAR global ENV, set them if they do not exist

And this line hints at adding those path lines that may be missing:
REM change this lines to match the paths of your system

Here is what I found, but I ran out of time to find the actual code that inserted the C:\ or the php5 - which may be related to having a php5.ini file in this xampp\php directory???:

DesiredUsername wrote:... I discovered this while typing in the command pear config-show in a command prompt at the xampp directory. There were about three paths which used C:\php5. I changed them to what they should be by using pear config-set. This may have removed the traces of the problem.
Check and see if config-set entered or changed any entry in the pear.bat file which will be a further clue that this pear.bat file is at the top of the suspects list - the pear.bat file has been known to cause issues in the past.


Here is what I see on issuing the config-show command on my installed XAMPP - no C:\php5 or odd environment variables evident:
Code: Select all
C:\xampp>pear config-show
CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          \xampp\php
PEAR documentation directory   doc_dir          \xampp\php\pear\docs
PHP extension directory        ext_dir          \xampp\php\ext
PEAR directory                 php_dir          \xampp\php\pear
PEAR Installer cache directory cache_dir        \xampp\tmp
PEAR data directory            data_dir         \xampp\php\pear\data
PHP CLI/CGI binary             php_bin          \xampp\php\php.exe
PEAR test directory            test_dir         \xampp\php\pear\tests
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            0
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          c:\gnupg\gpg.exe
Signature Key Directory        sig_keydir       \xampp\php\pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         \xampp\php\pear.ini
System Configuration File      Filename         \xampp\php\pearsys.ini

C:\xampp\php>
Which pretty much mirrors the return of this command in the link you provided.
BTW, did you add the C:\Program Files\xampp\php path to your System Variables as suggested in this article?
Set PHP Paths
Add c:\xampp\php to the end of the PATH in ControlPanel/System/Advanced/EnvironmentVariables


Make sure that in this section of the php.ini file in the apache\bin directory it has the correct entries which on my installation looks like this but yours may be different
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;C:\xampp\php\pear\;C:\xampp\php\zf\library;C:\xampp\php\zf\incubator\library"
Make sure you use the full path and in your case, for example, it may look like this:
".;C:\Program Files\xampp\php\pear\ ...."
... and the same applies to this entry:
Code: Select all
; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\Program Files\xampp\php\ext"

... and any other paths in the php.ini file that may not have the full path to the locations.

Not setting the correct paths in this ini file may well be the root cause of your original issue so I did some configuration changes to try and replicate your issue.

I have been successful in replicating your C:\php5 issue by adding C:\ to the above php.ini path:
include_path = ".;C:\;C:\xampp\php\pear\;C:\xampp\php\zf\library;C:\xampp\php\zf\incubator\library"

I get the same result if the line looks like this:
include_path = ""
Which is how it looks in the php5.ini file in the .\xampp\php directory and is of course the wrong php.ini file to use, the correct file to use is in the .\xampp\apache\bin directory.

This is the result using the incorrect paths in the .\xampp\apache\bin\php.ini file:
Code: Select all
C:\xampp>pear config-show
CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          \xampp\php
PEAR documentation directory   doc_dir          C:\php5\pear\docs
PHP extension directory        ext_dir          C:\xampp\php\ext\
PEAR directory                 php_dir          \xampp\php\pear
PEAR Installer cache directory cache_dir        C:\DOCUME~1\IZZYAN~1\LOCALS~1\Temp\pear\cache
PEAR configuration file        cfg_dir          C:\php5\pear\cfg
directory
PEAR data directory            data_dir         C:\php5\pear\data
PEAR Installer download        download_dir     C:\DOCUME~1\IZZYAN~1\LOCALS~1\Temp\pear\download
directory
PHP CLI/CGI binary             php_bin          \xampp\php\php.exe
php.ini location               php_ini          <not set>
PEAR Installer temp directory  temp_dir         C:\DOCUME~1\IZZYAN~1\LOCALS~1\Temp\pear\temp
PEAR test directory            test_dir         C:\php5\pear\tests
PEAR www files directory       www_dir          C:\php5\pear\www
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            0
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          c:\gnupg\gpg.exe
Signature Key Directory        sig_keydir       C:\WINDOWS\pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         C:\WINDOWS\pear.ini
System Configuration File      Filename         C:\WINDOWS\pearsys.ini

C:\xampp>
As you can clearly see the C:\php5 has now reared it's ugly head.
So if the path in the php.ini is incorrect or missing or the directory or file Pear is looking for is missing or incorrect it defaults to a global environment variable or adds php5 to the C:\ directory and I believe this behavior is set by a Pear file and not by XAMPP.


DesiredUsername wrote:... The following site also reports the problem http://trac.symfony-project.com/wiki/BeginningSymfonyWithPear. They ran xampp-setup.bat, and had it installed in C:\xampp. So I have to conclude that there is something else which is a problem, besides where I set it up or how I did so.

Perhaps you might also like to point out in the above link you provided where exactly your C:\php5 issue is being reported.

Finally if you would prefer, you can delete the Pear installation included in XAMPP and download and install the latest version from http://pear.php.net/
If you install into it's current location there is no need to change any include paths in the php.ini file.

As always, when posting my comments on these types of subjects, I stand to be corrected by anyone with more knowledge and a deeper understanding of the subject than I.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby ospx » 01. October 2008 10:16

remark:

The path C:\php5 and the mentioned subdirs are hardcoded in (I beliefe) config.php in the pear package (pear-core package). This paths are used, if pear can't found any (pear).ini file(configuration file).
Note, the name pear.ini can be switched to any name ( *.ini) but have to be readable to pear. Inside this ini -file(s) are only an serialized php-object.

Pear looks for a user -ini -file, after that for a sys -ini -file. If nothing of both could be found, it uses hardcoded default - paths for configurations (C:\php5).
ospx
 
Posts: 7
Joined: 13. December 2006 19:24


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 79 guests