gabrielbuzzi's avatar

Modify storage file: permission denied

I already setted the right permissions to my storage folder sudo chgrp -R www-data storage bootstrap/cacheand sudo chmod -R ug+rwx storage bootstrap/cache this works fine, but the problem is that i build a script that add a watermark in the overdue pdfs, but for some reason i get copy(): permission denied.

I tried to set chmod -R 777 /storage/app/documents but when i upload a new file the new file permission, deny to use the copy() method of php.

[ErrorException]                                                                                                          
  copy(path/storage/app/documents/b0ddef9e8d7f5ebb058161ba4741e776.pdf): failed to open stream: Permission denied
0 likes
1 reply
ankitparmar372's avatar

1.cd {laravel_root}/storage 2.mkdir -pv framework/views app framework/sessions framework/cache 3.cd .. 4.chmod 777 -R storage 5.chown -R www-data:www-data storage

Please or to participate in this conversation.