Problem installing PEAR (mkdir(): Invalid argument ... System.php on line 302)

For the last 3 and half hours now I’ve been trying to install PEAR and I just can’t get it to work. I know I installed it at work at that was very easy, but here at home it keeps crashing. Here is the log of when I try to install it:


Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : C:\\wamp\\bin\\php\\php5.3.5
 2. Temporary directory for processing            : C:\\wamp\\bin\\php\\php5.3.5\	mp
 3. Temporary directory for downloads             : C:\\wamp\\bin\\php\\php5.3.5\	mp
 4. Binaries directory                            : C:\\wamp\\bin\\php\\php5.3.5
 5. PHP code directory ($php_dir)                 : C:\\wamp\\bin\\php\\php5.3.5\\pear
 6. Documentation directory                       : C:\\wamp\\bin\\php\\php5.3.5\\docs
 7. Data directory                                : C:\\wamp\\bin\\php\\php5.3.5\\data
 8. User-modifiable configuration files directory : C:\\wamp\\bin\\php\\php5.3.5\\cfg
 9. Public Web Files directory                    : C:\\wamp\\bin\\php\\php5.3.5\\www
10. Tests directory                               : C:\\wamp\\bin\\php\\php5.3.5\	ests
11. Name of configuration file                    : C:\\Windows\\pear.ini
12. Path to CLI php.exe                           : C:\\wamp\\bin\\php\\php5.3.5

1-12, 'all' or Enter to continue:
Beginning install...
Configuration written to C:\\Windows\\pear.ini...
Initialized registry...
Preparing to install...
installing phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.7.tar...
installing phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.3.0.tar...
installing phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.9.3.tar...
installing phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.4.tar...
installing phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.1.tar...
PHP Warning:  mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302
PHP Stack trace:
PHP   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
PHP   2. require_once() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:1236
PHP   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
PHP   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
PHP   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
PHP   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:271
PHP   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
PHP   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
PHP   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
PHP  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

Warning: mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302

Call Stack:
    0.0440     747712   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
    0.0444     743488   2. require_once('phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php') C:\\wamp\\bin\\php\\php5.3.5\\go-pear
.phar:1236
    0.0995    4099944   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
    2.0980    4110472   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
    2.1404    4642776   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
    2.1404    4642776   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:
271
    3.3360   10292456   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
    3.3365   10292704   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
    3.3369   10294232   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
    3.3379   10295896  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

ERROR: file \\Archive_Tar-1.3.7\\Archive\\Tar.php does not exist
PHP Warning:  mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302
PHP Stack trace:
PHP   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
PHP   2. require_once() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:1236
PHP   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
PHP   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
PHP   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
PHP   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:271
PHP   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
PHP   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
PHP   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
PHP  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

Warning: mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302

Call Stack:
    0.0440     747712   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
    0.0444     743488   2. require_once('phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php') C:\\wamp\\bin\\php\\php5.3.5\\go-pear
.phar:1236
    0.0995    4099944   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
    2.0980    4110472   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
    2.1404    4642776   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
    2.1404    4642776   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:
271
    3.3876   10320592   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
    3.3883   10320840   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
    3.3887   10322368   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
    3.3898   10324080  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

ERROR: file \\Console_Getopt-1.3.0\\Console\\Getopt.php does not exist
PHP Warning:  mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302
PHP Stack trace:
PHP   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
PHP   2. require_once() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:1236
PHP   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
PHP   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
PHP   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
PHP   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:271
PHP   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
PHP   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
PHP   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
PHP  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

Warning: mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302

Call Stack:
    0.0440     747712   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
    0.0444     743488   2. require_once('phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php') C:\\wamp\\bin\\php\\php5.3.5\\go-pear
.phar:1236
    0.0995    4099944   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
    2.0980    4110472   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
    2.1404    4642776   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
    2.1404    4642776   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:
271
    3.4288   10322240   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
    3.4296   10322488   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
    3.4300   10324016   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
    3.4311   10325728  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

ERROR: file \\Structures_Graph-1.0.4\\docs\\html\\media\\banner.css does not exist
PHP Warning:  mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302
PHP Stack trace:
PHP   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
PHP   2. require_once() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:1236
PHP   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
PHP   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
PHP   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
PHP   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:271
PHP   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
PHP   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
PHP   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
PHP  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

Warning: mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302

Call Stack:
    0.0440     747712   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
    0.0444     743488   2. require_once('phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php') C:\\wamp\\bin\\php\\php5.3.5\\go-pear
.phar:1236
    0.0995    4099944   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
    2.0980    4110472   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
    2.1404    4642776   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
    2.1404    4642776   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:
271
    3.6613   10327112   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
    3.6621   10327352   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
    3.6625   10328880   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
    3.6636   10330592  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

ERROR: file \\XML_Util-1.2.1\\examples\\example.php does not exist
PHP Warning:  mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302
PHP Stack trace:
PHP   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
PHP   2. require_once() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:1236
PHP   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
PHP   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
PHP   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
PHP   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:271
PHP   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
PHP   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
PHP   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
PHP  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

Warning: mkdir(): Invalid argument in phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php on line 302

Call Stack:
    0.0440     747712   1. {main}() C:\\wamp\\bin\\php\\php5.3.5\\go-pear.phar:0
    0.0444     743488   2. require_once('phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php') C:\\wamp\\bin\\php\\php5.3.5\\go-pear
.phar:1236
    0.0995    4099944   3. PEAR_Start_CLI->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/index.php:7
    2.0980    4110472   4. PEAR_Start->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start/CLI.php:57
    2.1404    4642776   5. PEAR_Command_Common->run() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Start.php:324
    2.1404    4642776   6. PEAR_Command_Install->doInstall() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Common.php:
271
    3.8378   10328632   7. PEAR_Installer->install() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Command/Install.php:708
    3.8386   10328872   8. System->mktemp() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/PEAR/Installer.php:1107
    3.8389   10330400   9. System->mkDir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:428
    3.8400   10332112  10. mkdir() phar://C:/wamp/bin/php/php5.3.5/go-pear.phar/System.php:302

ERROR: file \\PEAR-1.9.3\\OS\\Guess.php does not exist

** WARNING! Old version found at C:\\wamp\\bin\\php\\php5.3.5, please remove it or be sure to use the new c:\\wamp\\bin\\php\\php5.3.5\\pea
r.bat command

The 'pear' command is now at your service at c:\\wamp\\bin\\php\\php5.3.5\\pear.bat

** The 'pear' command is not currently in your PATH, so you need to
** use 'c:\\wamp\\bin\\php\\php5.3.5\\pear.bat' until you have added
** 'C:\\wamp\\bin\\php\\php5.3.5' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

  http://pear.php.net/faq.php
  http://pear.php.net/manual/

Thanks for using go-pear!



* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under C:\\wamp\\bin\\php\\php5.3.5PEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.

I’m using WampServer 2.1e 32bit with php5.3.5 on Windows 7 ultimate x64, and I did start the command line in Administrator mode (start > run > cmd, ctrl+shift+enter, yes)

As you can see it says that there’s a problem with mkdir in System.php line 302, but I really can’t figure out anything else from there.

I’ve tried re-installing WAMP (several times), but that didn’t seem to help either.

This is the go-pear.phar I downloaded from pear.php.net BTW (http://pear.php.net/go-pear.phar). I also tried the one bundled with WampServer. That one did work but was too old too be able to install PHPUnit, which is why I “want” (okay, “have to install”; right now “want” really isn’t the correct term) PEAR in the first place.

:injured:

Alright, problem solved !

The key to solving the problem is that PEAR is able to update itself. So, you don’t have to install the latest PEAR, but you can install any version of PEAR and then let that upgrade itself to the latest version.

In my case I downloaded PHP 5.2.16 from php.net (the .tar.gz, not the installer), unpacked it, and put it’s pear-install-nozlib.phar --which can be found in the php-5.2.16/pear/ directory-- in my WAMP \bin\php\php5.3.5 directory, and then installed it (from an elevated --i.e. Admin persmissions) command line


php pear-install-nozlib.phar

Then when that was done (and it worked, yay!) I let PEAR upgrade itself


pear upgrade pear

Voila, you’ve got yourself a fully working latest PEAR install :smiley:

Of course that wasn’t the end of it (it never is …).
When I tried to install PHPUnit (as per the instructions here), it told me that there was no release available (even though there was, pear remote-list -c phpunit listed it just fine).
To solve that I had to empty the cache directory PEAR created in my profile (%APPDATA%\Local\Temp\pear). Once I deleted that directory and everything in it, everything was good to go, and I’ve got a me a fully working PHP / PEAR / NetBeans / PHPUnit / Selenium TDD stack now :smiley:

As for the go-pear.phar that is currently on pear.php.net, I tried that on a completely different PC today (running WampServer2/PHP5.2.8) and it gave the exact same error, so I’m pretty sure that that one just won’t install on a Win7 x64 machine (dunno about x68, haven’t tried). I’ve filed a bug report about it on pear.php.net.