Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing PEAR on Windows 7 using phar

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?

like image 250
Dan Steele Avatar asked Feb 14 '11 21:02

Dan Steele


3 Answers

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
like image 66
Flion Avatar answered Nov 05 '22 07:11

Flion


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

like image 14
Sundance Avatar answered Nov 05 '22 08:11

Sundance


$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

like image 2
mohammad emami Avatar answered Nov 05 '22 07:11

mohammad emami