I'm trying to install Laravel on WSL. I have everything install so far but when I run the laravel command, I get a Permission Denied from ZipArchive. Is there a way around this?
Things I've tried:
Directory is 777 -r
Owner of directory errored with my user and www-data
Making the file 777
PHP Warning: file_put_contents(/var/www/laravel_*.zip): failed to open stream: Permission denied in /home/jeff/.composer/vendor/laravel/installer/src/NewCommand.php on line 132
PHP Warning: ZipArchive::extractTo(): Permission denied in /home/jeff/.composer/vendor/laravel/installer/src/NewCommand.php on line 150
PHP Warning: ZipArchive::close(): Invalid or uninitialized Zip object in /home/jeff/.composer/vendor/laravel/installer/src/NewCommand.php on line 152
Composer could not find a composer.json file in /var/www
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Application ready! Build something amazing.
Try to run the bash as Admin. And use composer create-project --prefer-dist laravel/laravel to create laravel project than using the global laravel installer.
Do try Laragon if you want to develop in windows.
Related
I'm trying to create a new Symfony project.
When I launch the installer: symfony new sitepro --version=6.0.* --webapp
The installation start but then there is 2 errors:
[RuntimeException]
The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems): ZipArchive::extractTo(C:\User
s\Shiyo\Desktop\Pro\Projets\sitepro/vendor/composer/b67ec329/php-fig-cache-aa5030c/LICENSE.txt): Failed to open stream: Permission denied
[ErrorException]
ZipArchive::extractTo(C:\Users\Shiyo\Desktop\Pro\Projets\sitepro/vendor/composer/b67ec329/php-fig-cache-aa5030c/LICENSE.txt): Failed to open stream: Pe
rmission denied
unable to run C:\composer\composer.phar create-project symfony/skeleton C:\Users\Shiyo\Desktop\Pro\Projets\sitepro 6.0.* --no-interaction
I'm working on Windows 10, php 8.1.6.
I tried composer clearcache, to uninstall and install 7-Zip and I have all the permissions for this folder so I really don't get why I have this error.
Thanks for your help!
The problem was the Desktop folder of Windows. It has special rights. I tried on an other folder and it work perfectly!
I am trying to create new Laravel application.
I have installed XAMPP and Composer.
With Composer ( composer global require laravel/installer ) I have installed Laravel.
But when I try to use laravel new firstProject command to create new command the instalation throws two errors.
I am using Windows 10 if that helps.
[RuntimeException]
The archive may contain identical file names with different capitalization (which fails on case insensitive filesys
tems): ZipArchive::extractTo(C:\Users\User1\Desktop\PHP/vendor/composer/374ddf59/laravel-laravel-8e55104\public/rob
ots.txt): Failed to open stream: Permission denied
[ErrorException]
ZipArchive::extractTo(C:\Users\User1\Desktop\PHP/vendor/composer/374ddf59/laravel-laravel-8e55104\public/robots.txt
): Failed to open stream: Permission denied
I have tried:
Reinstalling and updating composer
Reinstalling and updating Laravel
Changing folder where I want to create my project
Using the composer create-project laravel/laravel blog command to create new project through composer still the same errors as above
Read with understanding:
Failed to open stream: Permission denied.
This means that your command line have no access to read or write in current directory. You have to change directory permissions and it should work.
change permissions on windows
change permissions on mac
I had the same problem (Win10).
In my case, my antivirus (Avast) was denying access to composer, but I did not know because I had set Avast to silent mode, so it just denied permission without asking me.
Also, Avast quaranteened an important server.php file so artisan server would stop as soon as I tried loading a page. So I had to restore and allow that file too.
i have the solution.
You only need delete in c:\program file\7-Zip,
after you need, reinstall this software. 7-zip, You need download this software of webpage author.
after execute
laravel new your_app
and ready.
I've installed composer globally. After the download, I've followed the instructions and added:
mv composer.phar /usr/local/bin/composer
So, now, I'm getting in the folder /var/www/html/buscador and tried to install a project. The Github instruction indicates that I should use:
composer require meilisearch/meilisearch-php guzzlehttp/guzzle http-interop/http-factory-guzzle:^1.0
But using it I get:
file_put_contents(./composer.json): failed to open stream:
Permission denied
I've looked for an answer to this, so I've tried this: (rosamunda is my user)
sudo chown -R rosamunda ~/.composer/
It ask for my password and then I get:
chown: cannot access '/home/rosamunda/.composer/': No such file or
directory
What am I doing wrong?
You need to run composer init before running composer require ..., this will create the composer.json file in the directory
I am trying to create a brand new Symfony 2.7 project and I'm following the installation instructions in the Symfony Book. I am running Mac OS 10.10.2. My php version is 5.4. When I try to create the new project with the following command:
$ symfony new myproject
I get the following error:
PHP Warning: require(phar:///usr/local/bin/symfony/symfony): failed to open stream: phar error: Cannot open temporary file for decompressing phar archive "/usr/local/bin/symfony" file "symfony" in /usr/local/bin/symfony on line 10
Warning: require(phar:///usr/local/bin/symfony/symfony): failed to open stream: phar error: Cannot open temporary file for decompressing phar archive "/usr/local/bin/symfony" file "symfony" in /usr/local/bin/symfony on line 10
PHP Fatal error: require(): Failed opening required 'phar:///usr/local/bin/symfony/symfony' (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear') in /usr/local/bin/symfony on line 10
Fatal error: require(): Failed opening required 'phar:///usr/local/bin/symfony/symfony' (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear') in /usr/local/bin/symfony on line 10
In the past I have created Symfony projects using composer and have had no issues. Any help is greatly appreciated.
I use these steps (under Linux) because I had the same errors:
in your public_html directory launch these commands to create a "local" symfony installer file (not /usr/local/bin/symfony like explain in https://github.com/symfony/symfony-installer)
curl -LsS http://symfony.com/installer -o symfony
chmod +x symfony
then launch the installer for symfony demo application with php
php symfony demo
or create a new symfony project
php symfony new project_name
then visit http://localhost/symfony_demo/web/config.php or http://localhost/project_name/web/config.php to configure the symfony project
PS: check the permission of file or directories
After creating a fresh installation of laravel 4, installing all the composer dependancies and going to the url where the installation is located I get this error:
ErrorException: Warning: file_put_contents(/var/www/mysite/app/config/../storage/meta/services.json): failed to open stream: Permission denied in /var/www/mysite/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php line 77
Any idea's why or what this error is, and how I can fix it?
Solved by running chmod -R 775 on the storage directory.