I'm trying to install Prestissimo to an Ubuntu 16.04 server, but that leads to an error:
$ composer global require "hirak/prestissimo:^0.3" Changed current directory to /home/kramer65/.composer [ErrorException] file_put_contents(./composer.json): failed to open stream: Permission denied require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]...
I'm logged in as user kramer65
, so I wouldn't know why it can't write to my home folder. My normal reaction to a permission denied
is to use sudo
, but composer then always says:
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Any idea how I can solve this?
To update your packages json file is. Run composer update (on your local machine) to update the required packages and re-generate a composer. lock file. Commit the updated composer.
composer. json is a JSON file placed in the root folder of PHP project. Its purpose is to specify a common project properties, meta data and dependencies, and it is a part of vast array of existing projects.
Description. A installed. json file was discovered. Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
I'm using Ubuntu 20.04. Does anyone know what should I do? This issue can easily be solved by creating the lock file and then modifying the ownership. composer install is trying to create a .composer.lock file in your project directory, so php should have permission to do that.
composer install is trying to create a .composer.lock file in your project directory, so php should have permission to do that. A quick hack is to use sudo composer install , but this is not the recommended way.
This issue can easily be solved by creating the lock file and then modifying the ownership. composer install is trying to create a .composer.lock file in your project directory, so php should have permission to do that.
You may also need to remove the .composer file from the current directory, to do this open up a terminal window and type this command: For me, in Ubuntu 18.04. I needed to chown inside ~/.config/composer/ Then global commands work. In my case I don't have issues with ~/.composer.
I had this problem to install laravel/lumen.
It can be resolved with the following command:
$ sudo chown -R $USER ~/.composer/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With