Shivam Chaurasia
Shivam Chaurasia

Reputation: 494

PHPUnit throwing broken signature error

Followed the steps for PHPUnit installation in windows from source site but got broken signature exception on issuing version command:

php phpunit-5.6.5.phar --version

PHP Fatal error:  Uncaught PharException: phar "C:\xampp\htdocs\phpunit-5.6.5.ph
ar" has a broken signature in C:\xampp\htdocs\phpunit-5.6.5.phar:21
Stack trace:
#0 C:\xampp\htdocs\phpunit-5.6.5.phar(21): Phar::mapPhar('phpunit-5.6.5.p...')
#1 {main}
  thrown in C:\xampp\htdocs\phpunit-5.6.5.phar on line 21

Fatal error: Uncaught PharException: phar "C:\xampp\htdocs\phpunit-5.6.5.phar" h
as a broken signature in C:\xampp\htdocs\phpunit-5.6.5.phar:21
Stack trace:
#0 C:\xampp\htdocs\phpunit-5.6.5.phar(21): Phar::mapPhar('phpunit-5.6.5.p...')
#1 {main}
  thrown in C:\xampp\htdocs\phpunit-5.6.5.phar on line 21

Upvotes: 1

Views: 1275

Answers (2)

Kim Steinhaug
Kim Steinhaug

Reputation: 502

I have been working in the same problem for 2 hours now, trying to rebuild and recompile PHAR files in all possible ways hoping one would work. Luckily I noticed that my FTP tool had started transfering PHP files as ASCHII - this was the prblem as the PHAR files needs to be BINARY. Make sure you are handling the files BINARY and not ASCII, hope it helps.

Upvotes: 1

mattxtlm
mattxtlm

Reputation: 128

It seems that your download of the phpunit.phar was not complete in the first place. Try to download it again from the source and make sure the size of the file is as expected. It worked for me.

Upvotes: 0

Related Questions