Search code examples
laravelpermissionsinstallationxampponedrive

Insufficient permissions when installing laravel in Onedrive folder


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?


Solution

  • 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.