Tips when PEAR cannot be installed in a XAMPP environment
This is Yamada from the Systems Department.
This time I will talk about when I had a problem with the Windows Xampp environment.
For a certain project, I needed to handle a large amount of XML log files, so
I decided to use the PEAR library's 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/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 ERROR: failed to mkdir C:\php\pear\docs\XML_Query2XML\cases\case01
An error occurred during installation! ! !
"failed to mkdir C:\php\pear\docs\XML_Query2XML\cases\case01"? ? ?
In my environment, I would like it to be created under "C:\xampp\php". . .
I thought there must be a mistake in the settings, 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)
doc_dir was carefully changed to "C:\php\pear\docs".
In my case, there is no directory called "C:\php", so I have to correct everything that specifies this path.
When I asked Google
how to fix it, he said, "Run C:\xampp\php\go-pear.phar," so I tried it.
C:\xampp\php>php go-pear.phar Could not open input file: go-pear.phar
That's a file.
Even when I searched for the file from Windows, 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 (abbreviated) )
Fixed it, 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 now.