Problem installing PHPUnit

I’m following along with the book “Agile Web Application Development…with Yii etc.” I just started the part about unit testing in chapter 2, however when I follow the instructions on installing PHPUnit through pear, I receive a fatal error “Allowed memory size of x exhausted.” I tried increasing the allotted memory to 1024 in the top of PEAR.PHP using ini_set(‘memory_limit’,‘1024M’); But this just caused CLI to crash.

Here’s the full error message:

C:\xampp\htdocs\yii_sc2>pear channel-discover pear.phpunit.de

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate

269279590 bytes) in C:\xampp\php\PEAR\PEAR.php on line 719

Call Stack:

0.0015     535368   1. {main}() C:\xampp\php\PEAR\pearcmd.php:0


0.0986    3506816   2. PEAR::popErrorHandling() C:\xampp\php\PEAR\pearcmd.ph

p:269

Any ideas?

Thanks in advance

-Rich

Change your memory_limit in your php.ini.

I think that should do it :)

That did not do it. Changing the memory limit in php.ini is the same as setting it at the top of a script; this caused my PHP CLI to crash. However, I got these commands to work after doing a pear upgrade command.

Pear’s installer is rubbish when installing PHPUnit. I manually install it in the correct include directory to overcome the issue.