I keep receiving an error when trying to install Laravel.
I already run cmd as administrator and tried fixing this by un-ticking the folder attributes in properties which says
"Read-Only (Only applies to files in folder)"
with the hope that the permission is now accessible by Composer. The problem occurs when I run this command line:
composer global require laravel/installer
I still get this error message:
[ErrorException]
file_put_contents(C:\Users\fikri\AppData\Roaming\Composer): failed to
open stream: Permission denied
if you are windos user, open cmd or git bash with administrator privilege
if you are linux user install with super user privilege
sudo composer global require laravel/installer
Related
Error: EACCES: permission denied, open ‘/Users/palisaski/Library/Application Support/Cypress/cy/production/projects/CyZavrsniProjekat-3356f9979cb849d912b38aef8a005fde/bundles/cypress/integration/homePageTests.js’
On Mac, tried to run some scripts, but keep getting this message. I am using sudo command to run cypress.
Cypress requires root access, you need to install it accordingly and make sure you have the proper permissions. See #1281
Getting error "EACCES: permission denied" when i install cypress
I am getting this error while installing Laravel latest version on ubuntu 18.04
[ErrorException]
file_put_contents(./composer.lock): failed to open stream: Permission denied
I have even run the following command as suggested by someone in response to the same question
sudo chown -R myuser ~/.composer
Still same error any ideas?
My error was exactly like below after this command: composer update.
[ErrorException]
file_put_contents(./composer.lock): failed to open stream: Permission denied
Solved it only adding sudo command in ubuntu. Full command will be:
sudo composer update
How do you run your php? If it starts when you visit page in browser, then user is www-data and of course there are no permissions.
I think you should try change group of this file:
sudo chgrp www-data ./composer.lock
But I am wondering why do you write into composer lock file? Are you ok?
I am typing this command in cmd composer global require laravel/installer
as typing this command ,this exception appears:
[Error Exception]
file _get _contents (C:\Users\ Boushra\ AppData\Roaming\Composer): failed to open stream: Permission denied
Use composer create-project --prefer-dist laravel/laravel someproject instead
Or you can try open the Command as Administrator (Right click in the CMD icon and click Run as Administrator). I prefer the command with create-project.
Initially I was trying to update to Laravel 5.6 from 5.5, however nothing works anymore since I ran composer update. I can't even go back to 5.5, always get the same error:
In Filesystem.php line 122:
file_put_contents(C:\Users...\laravelprojectroot\bootstrap/cache/packages.php): failed to open stream: Permission denied
I tried deleting the cache, deleting vendor dictionary and deleting packages.php. Once I ran composer update, I cannot edit or delete packages.php even with root permission on my laptop.
Please help.
Open cmd prompt or git bash with admin privilege, That solves this issue.
Create these directories if they don't exist:
storage/framework/cache
storage/framework/sessions
storage/framework/views
Then delete bootstrap/cache files
Test if it works, if not, try giving the correct permissions to the storage folder: chmod -R 775 storage/
First off: I'm very familiar with Composer and also Symfony and some other MVC frameworks.
I tried the following installation documentation, but I'm stuck on how to properly install a laravel project as "apache:apache" under "/var/www/html" on a CentOS 6 virtual machine.
I ran the composer global require "laravel/installer" command, and it says to put "~/.composer/vendor/bin" in your PATH. So I presume this command (laravel install) is done as a normal user (not root), and the folder will exist in your home directory when run.
I added to my path by editing my /etc/profile to include this. But when I try to run laravel new laraveltest in the /var/www/html folder (owned by apache), I get:
[abunk#Alvin-CentOS6 html]$ laravel new laraveltest
Crafting application...
PHP Warning: file_put_contents(/var/www/html/laravel_572e877d514bacbb7381860b8307a067.zip): failed to open stream: Permission denied in /tmp/.composer/vendor/laravel/installer/src/NewCommand.php on line 122
PHP Warning: ZipArchive::extractTo(): Permission denied in /tmp/.composer/vendor/laravel/installer/src/NewCommand.php on line 140
PHP Warning: ZipArchive::close(): Invalid or uninitialized Zip object in /tmp/.composer/vendor/laravel/installer/src/NewCommand.php on line 142
Composer could not find a composer.json file in /var/www/html
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Application ready! Build something amazing.
So then I copied the folder /home/abunk/.composer to /tmp/.composer; and then I ran su -s /bin/sh apache -c "laravel new laraveltest" from the /var/www/html folder (this should run as apache).
But instead I get this:
[abunk#Alvin-CentOS6 html]$ su -s /bin/sh apache -c "laravel new laraveltest"
Password:
Crafting application...
PHP Warning: proc_open(/dev/tty): failed to open stream: No such device or address in /tmp/.composer/vendor/symfony/process/Process.php on line 290
[Symfony\Component\Process\Exception\RuntimeException]
Unable to launch a new process.
new [--dev] [--] []
So my question is (or maybe this is really a bug): How do install as the apache user? Any recommendations?
I could do this as root user, but I think it's a bad idea to run Composer as root user.