I need to modify a PHAR file. Whenever I make changes to the file and then execute it I get the following error message:
Fatal error: Uncaught exception 'PharException' with message SHA1 signature could not be verified: broken signature'
By doing some research I found out that I can either
extract the phar, modify it and then "put it back into a phar file". How do I do that?
or set phar.require_hash = false
in my php.ini to disable the signature checking. This did not solve the problem unfortunately
I only have to do a few simple modifactions to the file and I'm the only one who is going to use it so I would prefer a quick and easy solution to the problem
The problem is that on the Symfony website the install command looks like this:
c:\> php -r "readfile('http://symfony.com/installer');" > symfony
The correct command is
c:\> php -r "readfile('http://symfony.com/installer');" > symfony.phar
And move the file symfony.phar
wherever you want to create your projects OR, just rename the file symfony
to symfony.phar
. If the file is named just symfony
you will get this error "sha1 signature could not be verified broken signature" because changing the name of the file will also invalidate the sha1 (that's how hashing works).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With