18

I'm trying to install PEAR for use with Wamp 2.1. The package does not come with any pear installation. I have read that you need to use http://pear.php.net/go-pear.phar to install PEAR for PHP 5.3 as the old go-pear.bat is now obsolete?

The instructions are to run the following command to install PEAR;

php -d phar.require_hash=0 PEAR/go-pear.phar

However, this is resulting in the following error;

manifest cannot be larger than 100 MB in phar "D:\wamp2\bin\php\php5.3.4\PEAR\go-pear.phar"

I'm sure this is due to a php setting I have correct somewhere, anyone have any ideas?

Dan Steele
  • 1,644
  • 3
  • 13
  • 13

5 Answers5

30

Even with "save as" directly from the browser I got the same error. The solution for me was to download it directly through the command line:

cd C:/php/bin/
curl -OL http://pear.php.net/go-pear.phar

this properly downloaded the .phar file and after the installation properly started with:

php -d phar.require_hash=0 go-pear.phar
Flion
  • 10,468
  • 13
  • 48
  • 68
  • Ditto. Copying and pasting the source code does not work. Downloading it directly with cURL gives you a valid .phar file to install. – PellucidWombat Dec 17 '17 at 00:48
14

I do. You are copying all the text and if you see at the bottom are some ASCII characters making the file bad.

Hope i helped you

Edit: you have to Download the file go-pear.phar from http://pear.php.net/go-pear.phar use some download manager then save as go-pear.phar into WampDir\php\PEAR\go-pear.phar

@Sundance

LeGEC
  • 46,477
  • 5
  • 57
  • 104
Sundance
  • 159
  • 3
  • That will result in a warning that the installed PHP version is too new for this file and you have to go back to the phar, which seems to be corrupted. – markus Mar 06 '11 at 10:25
  • Dont know why you get that "warning", im had the problem that Dan Steele and i can fixed it doeing what i said – Sundance Mar 07 '11 at 20:34
  • 2
    Worked for me too. I had the same warning, and updating the "go-pear.phar" file with the last version found at "http://pear.php.net/go-pear.phar" solved it for me. – LeGEC Apr 06 '11 at 07:45
  • 1
    same warning but this solution didnt solve it on WAMP 2.5 PHP 5.5.12 – Flion Jan 29 '16 at 17:23
2
$file = 'http://pear.php.net/go-pear.phar';
$file2 = 'C:\wamp\bin\php\php5.5.12\go-pear.phar';
// Open the file to get existing content
$current = file_get_contents($file);
// Write the contents back to the file

file_put_contents($file2, $current);

insert into cmd : php go-pear.phar

see alse : System or local when installing PEAR for PHPUnit http://www.geeksengine.com/article/install-pear-on-windows.html

Community
  • 1
  • 1
1
  • Right click on this link: https://pear.php.net/go-pear.phar
  • Save the file in your PEAR folder.
  • Go to the PEAR folder and open a command window
  • Run the file with php go-pear.phar

Note: Of course php.exe must be accessible. If if can't be found, add the folder php.exe resides to your PATH.

RWC
  • 4,697
  • 2
  • 22
  • 29
1
  1. 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
  1. Once downloaded, execute it
php -d phar.require_hash=0 go-pear.phar
  1. Follow the default prompts.

  2. 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.

  3. 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

  4. Restart all wampserver services

BOOM!