Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to Open Stream using laravel install

I am trying out Laravel and after installation I get the following when attempting to start a new application:

using code: laravel new blog

I get:

PHP Warning:  file_put_contents(/var/www/html/laravel_d4381b5ce250405766ef8b9fa784b256.zip): failed to open stream: Permission denied in /home/ren/.composer/vendor/laravel/installer/src/NewCommand.php on line 81
PHP Warning:  ZipArchive::extractTo(): Permission denied in /home/ren/.composer/vendor/laravel/installer/src/NewCommand.php on line 99
PHP Warning:  ZipArchive::close(): Invalid or unitialized Zip object in /home/ren/.composer/vendor/laravel/installer/src/NewCommand.php on line 101
Application ready! Build something amazing.
like image 283
TheCodingCat Avatar asked Feb 17 '15 23:02

TheCodingCat


1 Answers

It seems the user you're running the command with, doesn't have the necessary permissions to write to /var/www/html/. Try changing the permissions or owner of that directory. Try:

sudo chown $USER /var/www/html

The $USER variable contains the logged in username (in your case ren), so it will make your user the owner of that directory. Then run the installation command:

laravel new blog
like image 193
Bogdan Avatar answered Sep 29 '22 12:09

Bogdan