Running curl -sS https://getcomposer.org/installer | php gives me the following error:
#!/usr/bin/env php
All settings correct for using Composer
Downloading...
Could not create file /private/etc/apache2/users/composer.phar: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
Download failed: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
fwrite() expects parameter 1 to be resource, boolean given
Downloading...
Could not create file /private/etc/apache2/users/composer.phar: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
Download failed: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
fwrite() expects parameter 1 to be resource, boolean given
Downloading...
Could not create file /private/etc/apache2/users/composer.phar: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
Download failed: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
fwrite() expects parameter 1 to be resource, boolean given
The download failed repeatedly, aborting.
Not sure what permissions need to be changed to get this to work. I'm new to Mac OS. I've tried running the same command using sudo but to no avail. Any ideas on what needs to be changed in the apache2 directory to get this to work?
A simple chmod 777 on the users folder fixed the issue. Damn I feel like an idiot sometimes.
Related
I get this error exception when trying to execute the command
curl -s https://laravel.build/example-app | bash
I am referring to laravel documentation at https://laravel.com/docs/8.x to run laravel on Mac using Docker desktop.
While eventually the installation is successful (in spite of the error mentioned above) - I am unable to execute the command .vendor/bin/sail up as directed the documentation. Upon checking it appears that there is no directory BIN in Vendor directory under example-app folder.
This is the error I get
[ErrorException]
copy(/opt/example-app/vendor/composer/tmp-0a6597f2f29f634451109e2d3721420d):
Failed to open stream: No such file or directory
Can anyone help me with this error?
Thanks
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 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
I am getting this error while installing composer (sudo composer install).
Can anyone help me out?
Cannot create cache directory /home/tanmay/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/tanmay/.composer/cache/files/, or directory is not writable. Proceeding without cache
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded:
SSL operation failed with code 1. OpenSSL Error messages:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Failed to enable crypto
failed to open stream: operation failed
I tried today to install the composer on my mac from terminal. I used this command to download and install the composer inside my users folder
curl -sS https://getcomposer.org/installer | php
but when I press the enter I've got the following warning.
All settings correct for using Composer PHP Warning:
file_put_contents(/Users/test/.composer/keys.dev.pub): failed to open
stream: Permission denied in - on line 468
Warning: file_put_contents(/Users/test/.composer/keys.dev.pub): failed
to open stream: Permission denied in - on line 468 PHP Warning:
file_put_contents(/Users/test/.composer/keys.tags.pub): failed to open
stream: Permission denied in - on line 485
Warning: file_put_contents(/Users/test/.composer/keys.tags.pub): failed
to open stream: Permission denied in - on line 485 Downloading
1.2.0...
Composer successfully installed to: /Users/test/composer.phar Use it:
php composer.phar
Because the warning has to do with permissions I deleted the composer.phar that has been created and I executed again the same command using composer, but still getting the same warning. How I can fix this warning?
UPDATE
I did
curl -sS https://getcomposer.org/installer | sudo php
and it worked, but I want to know why. Thanks