Installing PEAR on Windows 7 using phar

28,257

Solution 1

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

Solution 2

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

Solution 3

$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

Share:
28,257
Dan Steele
Author by

Dan Steele

Updated on July 19, 2022

Comments

  • Dan Steele
    Dan Steele almost 2 years

    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?

  • markus
    markus about 13 years
    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.
  • Sundance
    Sundance about 13 years
    Dont know why you get that "warning", im had the problem that Dan Steele and i can fixed it doeing what i said
  • LeGEC
    LeGEC about 13 years
    Worked for me too. I had the same warning, and updating the "go-pear.phar" file with the last version found at "pear.php.net/go-pear.phar" solved it for me.
  • Flion
    Flion over 8 years
    same warning but this solution didnt solve it on WAMP 2.5 PHP 5.5.12
  • PellucidWombat
    PellucidWombat over 6 years
    Ditto. Copying and pasting the source code does not work. Downloading it directly with cURL gives you a valid .phar file to install.