comphar icon indicating copy to clipboard operation
comphar copied to clipboard

Permission denied: Disable "phar.readonly" and "phar.require_hash"

Open ghost opened this issue 5 years ago • 4 comments

I am trying to pack diff-parser I kept getting Permission denied: Disable "phar.readonly" and "phar.require_hash"

ghost avatar Apr 07 '20 22:04 ghost

Change ;phar.readonly = On to phar.readonly = Off in your php.ini. Notice the semicolon. Usually you can find this file in /etc/php/7.x/cli/php.ini

shino47 avatar Apr 10 '20 16:04 shino47

The problem is php.ini related, not a library bug. Please feel free to submit the PR that updates documentation! Thanks

mpyw avatar Apr 11 '20 16:04 mpyw

Nope! I've tried editing php.ini this is not effective! same error again and again nothing is resolved with php.ini changes. on windows run command: where comphar

C:\Users\asus\AppData\Roaming\Composer\vendor\bin\comphar C:\Users\asus\AppData\Roaming\Composer\vendor\bin\comphar.bat

edit comphar.bat find php "%BIN_TARGET%" %* replace php -d phar.readonly=off -d phar.require_hash=off "%BIN_TARGET%" %*

if you are on linux platform which comphar command will do the same job, simply add 2 parameters after php command php -d phar.readonly=off -d phar.require_hash=off

Good luck ,)

BurakBoz avatar Oct 30 '20 21:10 BurakBoz

this should only be enabled on dev/staging servers for security reasons

lordspace avatar Apr 05 '23 17:04 lordspace