Composer failed to open stream: Permission denied

19,512

I had a similar problem recently, and needed to change the permissions of my folders.

By running: php artisan cache:clear chmod -R 777 storage vendor composer dump-autoload

I was able to give all the permissions required to open files and write to them etc

Share:
19,512
Josh L. Minga
Author by

Josh L. Minga

Updated on June 22, 2022

Comments

  • Josh L. Minga
    Josh L. Minga almost 2 years

    am trying to install illuminate/html package in Laravel 5.1 using command composer require illuminate/html . But I get this error.

    [ErrorException]                                                             
    file_put_contents(C:\ProgramData\ComposerSetup\bin): 
    failed to open stream:  Permission denied
    
    require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update]
    [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] 
    [--sort-packages] [packages1] ... [packagesN]
    

    I believe Problem is permission to access that folder, I tried to remove read only protection but the protection return by default.

    Am running Windows10