Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

madala's avatar

[ErrorException] mkdir(): Permission denied

when I tried to create the laravel project with composer the following error occurs . [ErrorException] mkdir(): Permission denied

0 likes
5 replies
popcone's avatar

That means you do not have write permission on your project folder. Create a new folder, say 'myproject and run sudo chmod 777 myproject. Then move to 'myproject' folder and create project.

lara184461's avatar

for me in ubuntu 20.04

sudo chmod -R 755 /var/www/html

sudo chown -R username:username /var/www/html

niyazjamal's avatar

To solve this problem, go into your laravel project, make your public directory writable.

sudo chmod -R 755 public
Snapey's avatar

its a 4 year old question.

Why would the webserver need to write to the public folder?

scod's avatar

Try

php artisan config:cache &&  php artisan config:clear &&  composer dump-autoload -o

Please or to participate in this conversation.