Reputation: 14234
All the guides for installing PEAR on wampserver, such as the Symfony guide, say I am to run a go-pear.bat script within some PEAR directory.
I am on wampserver 2.1 and there is no PEAR directory and no go-pear batch script to be found.
Is this just different because I have a newer version? Is there somewhere I can download these missing installation scripts?
Upvotes: 19
Views: 42555
Reputation: 91
Following the accepted answer in 2023 did not work for a couple of reasons.
Error -- Deprecated: Function ereg() is deprecated in C:\wamp64\www\dev\pear\index.php on line 1461
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:
cd C:\wamp64\bin\php\php5.6.40
curl -OL http://pear.php.net/go-pear.phar
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!
Upvotes: 1
Reputation: 25
How it worked for me is,
I went to the PEAR official site and clicked on this link which brings you to go-pear.phar source. Then I saved the file by right clicking on the web page, under my php7.4 ( this is the PHP version I have set on my ENV variables ) folder.
Next opened up the command line as admin and did CD to that folder and ran the following command php go-pear.phar
.
This started the PEAR installation process and asked few questions. At the end I was asked to double click on "PEAR_ENV" reg file which was inside the php folder and done.
Hope this will helpful for someone.
Upvotes: 0
Reputation: 4522
This worked for me on windows 7:
http://www.steptoinstall.com/install-pear-wamp-server-windows-7-8.html
NOTE: Make sure you open command prompt window in administration mode.
Upvotes: 1
Reputation: 1042
Firts export in the PATH
system, add you folder with php, p.e. if you have php 5.4.x in your wamp system:
PATH=...;C:\wamp\bin\php\php5.4.x;
Create a new folder p.e.:
C:\wamp\bin\php\pear\
If your php version is 5.3 or or newer you can use pyrus.phar.
php pyrus.phar install pear/PEAR-1.9.4
Export you PATH
again:
PATH=....;C:\wamp\bin\php\pear;
you can use pear.bat, or pear.
pear.bat <arguments>
Check: for more information:
Upvotes: 1
Reputation: 1294
Rather new to pear myself, but my answer to a similar question: Running Wampserver 2.2 on Win7 Professional 64bit working with PHP 5.3.8 I have found a few issues with standard way of installing with go-pear. I downloaded the go-pear.phar and ran that via cmd with no deprecated errors etc.
Upvotes: 12
Reputation: 4971
you could also just go to the pear site, download the zips and unzip them in the correct local folders (wamp/bin/php)
we've just solved a similar problem like this, where a copy of a live site set up on a local machine was hitting errors because PEAR was not installed. The installation process was hitting errors so we just downloaded and unzipped PEAR and the required modules directly into the correct directory.
problem solved.
Upvotes: 1
Reputation: 145482
It's not installed per default on all setups.
But you can download the plain go-pear script for that: http://pear.php.net/go-pear
Either invoke it with php.exe go-pear
or run it through your webserver as regular .php script. (It has a nice installation GUI!)
Upvotes: 14