title: Laravel The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
body: <p>I'm running Laravel app on server (Ubuntu 16.04). I have an error</p>
  
  <blockquote>
    <p>The stream or file "/var/www/mydomain.com/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied  </p>
  </blockquote>
  
  <p>I've already google my question. I found <a href="https://stackoverflow.com/a/45673457/6478676">this answer</a>, but it wasn't helpful. I can't set 777 permission for storage (it's dangerous), as was suggested by many other answers I found.<br>
  Any other suggestions?</p>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <pre><code>sudo chgrp -R www-data storage bootstrap/cache
  sudo chmod -R ug+rwx storage bootstrap/cache
  </code></pre>
  
  <p>was helpful</p>