Tips when PEAR cannot be installed in a XAMPP environment

This is Yamada from the Systems Department.
This time, I'll be talking about what I did when I had trouble with the Windows Xampp environment.

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

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"...
Thinking that I must have made a mistake in the settings, 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_dir was set to "C:\php\pear\docs".
In my case, there is no directory called "C:\php", so I need to change all the places where this path is specified.

I asked Google how to fix it and they
told me to run C:\xampp\php\go-pear.phar, so I tried that.

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

There's no such file.
I searched for it in Windows, but it wasn't there.

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,004
X facebook Hatena Bookmark pocket

The person who wrote this article

About the author