I'm having error during updating composer. It's a Laravel 4 project which I've downloaded from .... and first time I updated it, it was fine and got updated. but due some reason I deleted that replace it with a fresh copy of that project, but now when I started to update it, it gives me the following error:
[ErrorException]
copy(/home/username/.composer/cache/files/symfony/security-core/3a27d7b34ee6
2cb0fdf5ad970e7777912ef4722f.zip): failed to open stream: Permission denied
In between first and second update of this composer I did the following:
Tried to installed Vagrant and homestead, but failed due to some internet connection problem.
Updated Composer failed
Uninstalled vagrant and reinstall composer.
Reinstalled Composer
Updated composer (success)
Tried to install vagrant and homestead (success)
Update composer (failed)
uninstalled vagrant
Reinstalled Composer
Update Composer (failed)
The above mentioned error is getting occured again and again. I also tried 'composer clearcache' but doesn't worked. One thing which I noticed that it's been 16-19 months I'm using composer and never heard of such errors, but since I tried to install vagrant it created hurdles and errors for me.
I'm using Ubuntu 15.04
Updating Laravel 4.0 project
Updating Laravel 5
both project got updated before installing vagrant and homestead, but not now.
/var/www is under the group of 'www-data' and 'username' also the part of this group.
Any help plz!!!!!!!!!!!!!!!
I found the solution. If you see the error then it would be clear that I don't had access to the:
"/home/username/.composer/cache/files/symfony/security-core/3a27d7b34ee62cb0fdf5ad970e7777912ef4722f.zip".
When I explore this directory, I found that its owner is 'root' or 'sudo'.
So I deleted the '.composer' directory and then started to update in my laravel project directory, every thing was fine and perfect! No problem at all!
sudo composer update
worked for me. it's a permission issue.
if it doesn't work then you can try to
delete '.composer' directory and composer update afterward.
I know its an old topic, but for mac users this might be useful, since commands in macOS are a little bit different from linux distros and I had a hard time figuring this out.
cd into ~ directory
sudo chmod -R 777 .composer
Done. Now you can install/update composer.
I had the same issue with a mac, Composer warn me about running commands with super user permissions, so I've just changed the owner of files directory in the repo /Users/MyUserName/.composer/cache like so:
sudo chown -R MyUserName files/
Hope this helps.
I just run sudo before an all when ok
sudo composer create-project laravel/laravel=5.3 /Users/peter/Sites/blog --prefer-dist
Related
I am trying to create my first Laravel project but i am having a problem with composer and some permissions (at least that's what i understand).
When I open my cmd to create a new Laravel project , using this command (create-project laravel/laravel basicwebsite), I get an error.
The error message is
“Cannot create cache directory C:\Mamp\htdocs/
C:\Users\giorg\AppData\Roaming\Composer/cache/repo/https---repo.packagist.org/,
or directory is not writable. Proceeding without cache”.
enter image description here
I am still new and I don’t know much but it seems that my folders are not writable or something similar.
I am using MAMP and windows 10.
Thanks in advance for your time.
If the folder is owned by root, even if you have admin privileges, you still dont have permission, this happens when you use sudo while installing composer.
It can be solved by
sudo chown -R $USER $HOME/.composer
The problem is with your composer installation, not the folder permissions.
You should probably install globally, but locally to your user, it should only be used by your user account and not by the web server
https://getcomposer.org/doc/00-intro.md#globally
Or
composer.phar create-project laravel/laravel basicwebsite
php composer.phar create-project laravel/laravel basicwebsite
Composer has worked fine without incident. I recently upgraded my Mac (Mojave) to PHP 7.2.12 using homebrew.
Now I'm unable to run composer. It simply hangs and does nothing, yet if I run it as sudo it runs fine.
I've already validated:
Composer lives in my /usr/local/bin folder and that folder is in the $PATH
Composer's permissions are 0755
I've checked the ~/.composer folder and it is owned by the user with proper permissions
I've tried removing it and re-installing, yet I experience the same hang as soon as I go to run php composer-setup.php
Any help or suggestions would be great.
While debugging my application I realized that when I ran the composer manager that it had a debug break in it that was being cause by xdebug in phpStorm.
So future note to anyone who encounters a similar issue, make sure your debugger is disabled when you run composer.
I've got this error in my laravel 5.2 project who hosted in debian linux
Warning: require_once(/home/u706561288/public_html/sap/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
Fatal error: require_once(): Failed opening required '/home/u706561288/public_html/sap/vendor/composer/autoload_real.php' (include_path='.:/opt/alt/php70/usr/share/pear') in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
so many forum like stackoverflow tell me to using php artisan "composer update" but
unfortunately my hosting package not available to composer instalation
please tell me how to fix this problem
I suggest that you test these steps
On the Localhost, run these two commands (composer update and composer dump-autoload)
Re-upload the entire project on the server
Also, if the problem is not resolved, you can delete the Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again.
When the hosting service or some PC does not allow to install Composer and appears error like in my case, follow these steps:
Delete all laravel project in hosting service. I recommend to use smartftp for good speed file access and tracked action.
Back to our localhost project and run composer install --no-scripts command and then composer clearcache.
Reupload all laravel project.
Don't forget to configure .env file.
I hope this can help with the same problem in future.
I had the same error while back, what I did to solve it was. I delete all the vendor folder from the root project then install it back by executing composer install
delete the Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again
this helped me
If anyone still facing the issue after deleting the vendor directory and did composer install try to update your composer by composer selfupdate then do the same install process.
I'm getting the above error when running composer install --working-dir=/path/to/directory
In case you're wondering: I had a hard drive failure so I needed to re-install composer and well... everything. After installing composer, navigating to the directory with the composer.json file and running composer install would result in an error that composer couldn't find a composer.json file, hence the --working-dir flag.
The project is a Laravel 4.2 project. We have everything in a git repo with the exception of the vendor folder. We figured we would just run composer install and all would be right in the world - and it was.
I ran composer install --verbose and received the following:
Exception trace:
() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:149
Composer\Util\ErrorHandler::handle() at n/a:n/a chdir() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:149
Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:83
Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/composer:43
require() at C:\ProgramData\ComposerSetup\bin\composer.phar:25
Any ideas would be appreciated. Not sure why I'm suddenly having these problems. A week or two ago a co-worker was able to run all of the same steps without error.
As it turns out, the main problem was the starting directory of gitbash.
When I installed it, I changed the starting directory to be c:\users\[me]\My Documents
Even though this directory had sub-directories, and I could cd into them; running an ls would produce 0 results.
I ended up changing the starting directory to c:\users\[me]\Documents and everything worked fine. Composer found the composer.json file and all other commands worked. Lesson learned.
Anything I try to execute in Laravel, even minor files locally gives this message in composer:
[Symfony\Component\Process\Exception\RuntimeException]
The process has been signaled with signal "11".
Using OSX 10.7.5
Any help appreciated, as always.
For example :
composer update
typed in terminal retrieves the error message above
Make sure to check your composer cache folder has the right permissions for all files and folders.
If you ever ran composer as sudo or root then these cache folders could have the wrong root permissions.
Look at all the files and folders inside:
ll ~/.composer/cache/
Make sure you have proper permissions to write files in app/storage directory. And you can always use the following method of installation.
cd /your/app/directory
git clone https://github.com/laravel/laravel.git .
composer install
I got this error due to circular dependency on AppServiceProvider (when 2 services depend on each other). As the error does say much it took me a loooong time figure it out :/
Try:
Reinstall or upgrade PHP (Cli)
Make sure your .composer directory permission
This error message from laravel artisan is caused by Composer command error, you can try the same way from using command like:
composer dump-autoload -o
It should also cause error relating from aristan optimize command which be trigger from post-update-cmd" in composer.json.
In my case, the error is segment fault via Cygwin PHP so that I change to use XAMPP PHP to run it and it worked.
Try to run thin command
composer dump-autoload
I eventually solved this by employing a freelancer who was excellent and very knowledgeable.
First needed to update OSX with Maverick (free) - (I had to change my hard drive to do this!)
Then needed to download xcode
Composer should then function, you may need a new installation of laravel
Hope that helps someone!