how can I create laravel project with jetstream on ubuntu 20.04. On their official page I need to run this command:
composer require laravel/jetstream
Before this I configured environment for laravel and got installed laravel installer globally. After I run this command to get jetstream it says:
[ErrorException] file_put_contents(./composer.json): failed to open stream: Permission denied
I have tried something like:
sudo chown -R $USER ~/.composer/
and
sudo chown -R user ~/.composer/
But then I get this:
No such file or directory
Did you try running it wirh root rights?
sudo composer require laravel/jetstream
Related
I had a laravel app on github and I want to clone on other computer .
After I cloned the repository and run composer install command it shows me this error:
[ErrorException]
copy(/Users/cosminciolacu/.composer/cache/files/symfony/debug/824e1c185cf2cd
10402999589458f4be7ef980e1.zip): failed to open stream: Permission denied
what I missed?
You may need to change the ownership and permissions of the directory you have installed the project in.
cd /path/to/project
sudo chmod -R 775 .
sudo chmod 660 .env
If the first answer did not work, do sudo composer install instead of composer install.
Warning: well, said in comment section.
I want to install composer for laravel development on my latest version of mac OS. I followed all the step by step instructions to install composer on the website and it installed composer.phar. So I have to move to /usr/local/bin/composer for it to work.
I ran the usual command:
mv composer.phar /usr/local/bin/composer
and it gave an error saying /usr/local/bin/composer: No such file or directory
I even added a sudo command in front to see if it works and received the same error. I looked up other solution telling me to make a new directory there, but it wouldn't let me do so and gave me a permission denied error.
You should create the directory manually before proceeding:
sudo mkdir -p /usr/local/bin
then
sudo mv composer.phar /usr/local/bin/composer
For solving your second problem
It needs zip extension,
Check your PHP version first
php -v
If for instance PHP version is 7.2, then try below command (use your PHP version)
brew update
brew install php#7.2
brew link php#7.2
I'm just starting with laravel. I'm following this laravel guide. My environment is an aws server running php 5.6, I have already installed composer.
https://laravel.com/docs/5.2/quickstart#deleting-tasks
When I type:
composer create-project laravel/laravel quickstart --prefer-dist
I get the following error:
Cannot create cache directory /home/ubuntu/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
How can I fix this? Is this a major problem? If I proceed would I run into trouble after?
Also, is it bad practice to use sudo?
When you installed composer pretty sure you used $ sudo command because of that the ~/.composer folder was created by the root.
Run this to fix the issue:
$ sudo chown -R $USER $HOME/.composer
You can try this method which I used for my project on a LAMP server
sudo composer create-project laravel/laravel quickstart --prefer-dist
After that, you change the permission back to www-data user & group
sudo chown www-data:www-data quickstart\ -R
sudo usermod -a -G www-data ubuntu_user_name
I know there are some questions about how to install composer on SO, but they did not help me.
I am trying to install composer (for laravel). I have OS X El Capitan.
I downloaded composer like this:
$ curl -sS https://getcomposer.org/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...
Composer successfully installed to: /Users/blckbird/composer.phar
Use it: php composer.par
Next, I tried to execute the laravel installation:
composer global require "laravel/installer"
Which did not work because:
-bash: composer: command not found
So I tried:
sudo mv composer.phar /usr/local/composer
Which worked, however, I still can not execute composer (same error as above).
What am I doing wrong and how can I install composer correct?
Since your composer.phar is installed in /Users/blckbird/, try this for global installation:
sudo mv /Users/blckbird/composer.phar /usr/local/bin/composer
Note: On some versions of OSX the /usr directory does not exist by default. If you receive the error "/usr/local/bin/composer: No such file or directory" then you must create the directory manually before proceeding: mkdir -p /usr/local/bin. More info.
I want to use laravel, so, firstly I have to install composer, I uploaded laravel in a folder "laravel" now i go to the folder and I do this
curl -sS https://getcomposer.org/installer | php
according the site of composer...
So, now, according laravel I should do this
composer create-project laravel/laravel
but returns "composer command not found"
When I finished installing composer I get this Use it: php composer.phar
So, I try again php composer.phar create-project laravel/laravel
and it runs,but it stays as Installing dependencies (incluiding require-dev) for a long long time.
My enviroment is Debian 6, and its a cloud server, so, internet should not be a problem.
It just stays like that, any idea what I'm doing wrong? How to solve this and make it run?
Thanks
$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer
# if you're installing as root or privileged account, don't leave the permissions on default 777
$ chmod 755 /usr/local/bin/composer
$ composer install