Following the accepted answer in 2023 did not work for a couple of reasons.
- Downloading the file at https://pear.php.net/go-pear and running it didn't go smoothly (either with web interface or CLI).
Error -- Deprecated: Function ereg() is deprecated in C:\wamp64\www\dev\pear\index.php on line 1461
- Downloaded a more recent version of the pear installer, and was met another error
Error -- manifest cannot be larger than 100 MB in phar "C:\wamp64\www\dev\pear\index.php"
because of some character encoding issue.
Here's what worked:
- Use the CLI to download the file -- cd C:\path\of\choice e.g.
cd C:\wamp64\bin\php\php5.6.40
curl -OL http://pear.php.net/go-pear.phar
- Once downloaded, execute it
php -d phar.require_hash=0 go-pear.phar
Follow the default prompts.
In the final step of installation make sure to allow the pear installer edit the php.ini to include the pear directory
Or you may do it manually. At the bottom of your php.ini
include_path=".;C:\wamp64\bin\php\php5.6.40\pear"
or search "include_path" uncomment (by removing the sarting ';') and edit in-between the quotes.
Here's the very important part if you use wampserver
apache has a separate php.ini, for me it is located at C:\wamp64\bin\apache\apacheX.XX.XX\bin
You need to also edit it, and put the include_path like above
Restart all wampserver services
BOOM!