I am currently trying to do a new Laravel install in a Onedrive folder with the following command:
laravel new blog or composer create-project --prefer-dist laravel/laravel blog
Unfortunately, I get the following error:
PHP Warning: file_put_contents(C:\Users\jordy\OneDrive\Websites\www.blog.nl/laravel_7198089e82dcd0b2debf8486652dfae3.zip): failed to open stream: Permission denied in C:\Users\jordy\AppData\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 133, including a few similar ones.
I run my command prompt as an Administrator on Windows 10, and my user account has full permissions on the Onedrive folder. If I try to do it in another directory outside the Onedrive, it works correctly.
How is this possible? Does Onedrive blocks something?
Found out that Bitdefender AntiVirus was the problem. I went to Application Access (under the Safe Files settings), and gave permissions to Apache and PHP CLI. Now it works.
(Running php files stored on OneDrive)
Actually, this also fixes the blank page issue on Laravel installations.
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
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.
Question:
What kind of permissions should I give to Composer on Windows?
Server information:
Windows 2012 R2
IIS 8.5
Error message:
[RuntimeException]
C:\inetpub\wwwroot/vendor does not exist and could not be created.
Steps that I've tried and thoughts:
I've installed Composer through the .exe file.
I have a composer.json file in C:\inetpub\wwwroot and when I try running composer install or composer update, I get the error message.
I've tried manually creating the vendor folder in the directory, but then it cannot download the package that I have in my composer.json file, giving roughly the same error message, that the package doesn't exist and could not be created.
I've googled the error, and I'm led to believe it's a permissions issue, however, I have installed Composer on another server and installed packages in the C:\inetpub\wwwroot directory without a problem. I've tried comparing security group permissions between the two servers for wwwroot and inetpub, and the permissions were the same. I had someone suggest trying to copy the .json file to My Documents on the server and try running composer install from there, and that worked. Which further indicates it's a permissions issue, but I can't figure out what.
After re-reading another Linux question, I figured out what the problem was. I need to be running Command Prompt as administrator. Now it works.
Please ensure that whether your deployment folder is having composer.lock file or not.' If not please deploy the file there.
I am new to laravel, composer, and windows terminal. I am trying to setup laravel on my local host. I currently have wamp installed and I have used it before to create basic websites. However, I am now doing a bigger project that needs a framework so I decided to learn Laravel. I installed composer as indicated in the directions, but when i run the command
"C:\wamp\www>composer create-project laravel/laravel laravel"
i generate an error message that says
"[InvalidArgumentException] Project directory laravel/ is not empty."
When I open a browser and navigate to "localhost/laravel/public" I encounter the error message from the title of this thread:
"Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such
I have also added the appropriate environment variables from the composer instructions.
I am really lost at this point, and I have spent the past 4 hours trying to debug this.
I am running Windows 8 x64.
Edit:
I tried running composer install in C:\wamp\www and received an error message
Composer could not find the config file:
C:\ProgramData]ComposerSetup\bin Ti initialize a project, please
create a composer.json file as described in the
http://getcomposer.org/ "Getting Started" section "
The dependencies for your project are not installed. Just download composer from GetComposer.org and install it on your Windows Machine. Then navigate to your project root, you will see a composer.json file there. That file specifies all the dependencies of the project. Run composer update in that directory. Composer will then update or install all required dependencies and your application won't show the error then.
cd \wamp\www\yourproject
composer update
"C:\wamp\www>composer create-project laravel/laravel laravel"
"[InvalidArgumentException] Project directory laravel/ is not empty."
This means C:\wamp\www\laravel already existed when you attempted to run the command. Remove the folder, or change the create-project command to use a different folder name for your new project.
"Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such
You need to do a composer install from C:\wamp\www\laravel.
I figured it out! I was missing a folder called "vendor" and a file inside bootstrap called "compiled.php" Sorry for the inconvenience, and thank you for trying!
use the following command to get vendor folder in your project
composer install --no-scripts
i had the same problem but i just ran this command
composer install
to install all the dependencies
I have just transferred my laravel application to another pc and I have installed composer. I am running composer install at the root of the project but it shows the following error:
{"error":{"type":"ErrorException","message":"file_put_contents(\/meta\/services.
json): failed to open stream: No such file or directory","file":"C:\\national-fl
eet\\vendor\\laravel\\framework\\src\\Illuminate\\Filesystem\\Filesystem.php","l
ine":71}}
I tried CACLS -R 755 app/storage (as admin)
and then composer update but the same error. bootstrap/compiled.php doesn't exists in my project. What should I do?
I got this error, because some folders in /app/storage were missing
To fix the error, I manually created the following folders:
app/storage/
app/storage/cache/
app/storage/logs/
app/storage/meta/
app/storage/sessions/
app/storage/views/
then delete the contents of my vendor folder and run composer update again
Try to remove the services.json in /meta (or rename it to something else) and try composer install again (or composer update). It is possible that the file hasn't got the correct rights for Laravel to write to.