Tips for when you can't install PEAR in a XAMPP environment

This is Yamada from the Systems Department.
This time, I'll talk about a problem I encountered in the Windows XAMPP environment.

I needed to handle a large XML log file for a certain project, so
I thought I'd try using the XML_Query2XML library from PEAR, but...

C:\xampp\php>pear install XML_Query2XML WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update Did not download optional dependencies: pear/Net_LDAP2, pear/I18N_UnicodeString, use --alldeps to download automatically pear/XML_Query2XML can optionally use package "pear/Net_LDAP2" pear / C:\php\pear\docs\XML_Query2XML\cases\case01

I got an error during installation!!!
"failed to mkdir C:\php\pear\docs\XML_Query2XML\cases\case01"???
In my environment, I want it to be created under "C:\xampp\php"...
I figured I must have made a configuration mistake, so I decided to check the PEAR settings.

C:\xampp\php>pear config-show CONFIGURATION (CHANNEL PEAR.PHP.NET): (omitted) PEAR executables directory bin_dir C:\xampp\php PEAR documentation directory doc_dir C:\php\pear\docs PHP extension directory ext_dir C:\xampp\php\ext PEAR directory php_dir C:\xampp\php\pear PEAR Installer cache directory cache_dir R:\Temp\pear\cache PEAR configuration file cfg_dir C:\php\pear\cfg directory PEAR data directory data_dir C:\php\pear\data PEAR Installer download download_dir R:\Temp\pear\download directory PHP CLI/CGI binary php_bin C:\xampp\php\.\php.exe php.ini location php_ini<not set> --program-prefix passed to php_prefix<not set> PHP's ./configure --program-suffix passed to php_suffix<not set> PHP's ./configure PEAR Installer temp directory temp_dir R:\Temp\pear\temp PEAR test directory test_dir C:\php\pear\tests PEAR www files directory www_dir C:\php\pear\www (omitted)

The doc_dirwas mistakenly set to "C:\php\pear\docs".
In my case, there is no directory called "C:\php", so I have to correct all instances where this path is specified.

I asked Google how to fix it, and
it said to "run C:\xampp\php\go-pear.phar," so I gave it a try.

C:\xampp\php>php go-pear.phar Could not open input file: go-pear.phar

I don't have a file like that.
I couldn't find it even when I searched for it in Windows.

I have no choice but to fix everything with config-set

C:\xampp\php>pear config-set doc_dir c:\xampp\php\pear\docs config-set succeeded C:\xampp\php>pear config-set cfg_dir c:\xampp\php\pear\cfg config-set succeeded C:\xampp\php>pear config-set data_dir c:\xampp\php\pear\data config-set succeeded C:\xampp\php>pear config-set temp_dir c:\xampp\php\pear\temp config-set succeeded C:\xampp\php>pear config-set test_dir c:\xampp\php\pear\tests config-set succeeded C:\xampp\php>pear config-set www_dir c:\xampp\php\pear\www config-set succeeded

Check if it is reflected properly

C:\xampp\php>pear config-show CONFIGURATION (CHANNEL PEAR.PHP.NET): (omitted) PEAR executables directory bin_dir C:\xampp\php PEAR documentation directory doc_dir c:\xampp\php\pear\docs PHP extension directory ext_dir C:\xampp\php\ext PEAR directory php_dir C:\xampp\php\pear PEAR Installer cache directory cache_dir R:\Temp\pear\cache PEAR configuration file cfg_dir c:\xampp\php\pear\cfg directory PEAR data directory data_dir c:\xampp\php\pear\data PEAR Installer download download_dir R:\Temp\pear\download directory PHP CLI/CGI binary php_bin C:\xampp\php\.\php.exe php.ini location php_ini<not set> --program-prefix passed to php_prefix<not set> PHP's ./configure --program-suffix passed to php_suffix<not set> PHP's ./configure PEAR Installer temp directory temp_dir c:\xampp\php\pear\temp PEAR test directory test_dir c:\xampp\php\pear\tests PEAR www files directory www_dir c:\xampp\php\pear\www (omitted)

It's fixed so I installed it again

C:\xampp\php>pear install XML_Query2XML WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update Did not download optional dependencies: pear/Net_LDAP2, pear/I18N_UnicodeString, use --alldeps to download automatically pear/XML_Query2XML can optionally use package "pear/Net_LDAP2" pear/XML_Query2XML can optionally use package "pear/I18N_UnicodeString" downloading XML_Query2XML-1.7.2.tgz ... Starting to download XML_Query2XML-1.7.2.tgz (388,604 bytes) .....done: 388,604 bytes install ok: channel://pear.php.net/XML_Query2XML-1.7.2

Done!!!!!!!!!!

That's all for this time

If you found this article helpful,please give it a "Like"!
0
Loading...
0 votes, average: 0.00 / 10
3,077
X Facebook Hatena Bookmark pocket

The person who wrote this article

About the author