PEAR installation on Windows from scratch

It occurred, that there were some difficulties installing PEAR on Windows, since it is no longer in the distro.

That is what I did [PHP 4.3.0]:

1) open a command window
2) c:\\php\\cli\\php.exe -n -r \”include \’http://go-pear.org/\’;\”
3) run through the install dialog
4) modify locations if you need to
5) after finishing you should have a \”.tmppear\” and maybe a \”pear.old_bat\” in \”c:\\php\”. if not, search for them.
6) put \”.tmppear\” to c:\\php
7) open a new \”pear.bat\” and write into it:
c:\\php\\cli\\php.exe -n c:\\php\\.tmppear — %1 %2 %3 %4 %5 %6 %7 %8 %9
8) make sure, \”c:\\php\\cli\” is in your environment variables. so now you should be able to reach \”pear.bat\” from everywhere.
9) run \”c:\\>pear config-show\”
10) modify e.g. \”c:\\>pear config-set php_bin c:\\php\\cli\\php.exe\” etc. etc.

… hope that helps. Another way is by using the tool provided by Christian Dickmann [1].

[1] http://dickmann.homeunix.org/pear/go-pear.html

Leave a Reply