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

ahmeda's avatar

The stream or file "/var/www/html/asu/storage/logs/laravel.log"

I just cloned my repo to DigitalOcean to /var/www/html/asu

then composer install I got this error:

The stream or file "/var/www/html/asu/storage/logs/laravel.log" could not be opened in appen d mode: failed to open stream: Permission denied

I run this but still get the error:

chmod -R o+w /var/www/html/asu/storage/

0 likes
5 replies
laracoft's avatar

@rabeea You are changing the permission of a different folder.

/var/www/html/first-project/storage/ is not /var/www/html/asu/storage/

laracoft's avatar

Who is the owner of the folder and files? Use ll to check.

Use chown -R <owner>:<group> <path> to update it.

ahmeda's avatar

@laracoft

I'm connecting as a user account to DigitalOcean

and ll :

total 12 drwxrwxr-x 2 www-data www-data 4096 Oct 1 12:07 ./ drwxrwxr-x 6 www-data www-data 4096 Oct 1 12:03 ../ -rwxrwxr-x 1 www-data www-data 14 Oct 1 12:03 .gitignore* -rwxrwxr-- 1 www-data www-data 0 Oct 1 12:07 laravel.log*

laracoft's avatar
laracoft
Best Answer
Level 27
  1. I suppose you are running composer as your user?
  2. Have you added your username to the group www-data
  3. edit /etc/group, find the line starting with www-data and add your username behind
  4. e.g. www-data:x:<number>:root,apache,<your username>
1 like

Please or to participate in this conversation.