UVdesk エラー「The stream or file “/var/log/dev.log” could not be opened: failed to open stream: Permission denied」が発生

UVdesk エラー「The stream or file “/var/log/dev.log” could not be opened: failed to open stream: Permission denied」が発生

ヘルプディスクツール「UVdesk」でエラー「The stream or file “/var/log/dev.log” could not be opened: failed to open stream: Permission denied」が発生した際の原因と解決法を記述してます。

環境

  • OS Ubuntu 20.10
  • php 7.4
  • Maria DB 10.3.25-MariaDB-0ubuntu1 Ubuntu 20.10
  • apache2 Apache/2.4.46 (Ubuntu)

エラー全文

ページアクセス時に以下のエラーが発生。

The stream or file "/var/www/html/helpdesk-project/var/log/dev.log" could not be opened: failed to open stream: Permission denied

原因

ファイルの権限が変更されていたため

解決法

権限を設定しなしてあげる

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