Have visited topics on this before to no avail - struggling to get rid of a permissions error "Failed to open stream" on logs/laravel.log, the only thing that works at the moment is setting directory permissions to 777, that of course in a live server production environment is extremely bad practice.
I've followed practically every tutorial, like this one for example is the most recent I've come across:
and this
https://www.howtoforge.com/tutorial/install-laravel-on-ubuntu-for-apache/
Generally speaking, some checks I've carried out include checking ownership/groups by running
ps aux | egrep '(apache|httpd)'
which returns the following results
root 6723 0.0 0.4 77944 4880 ? Ss 14:53 0:00 /usr/sbin/apache2 -k start www-data 6726 0.0 0.6 432716 6708 ? Sl 14:53 0:00 /usr/sbin/apache2 -k start www-data 6727 0.0 0.6 432772 6696 ? Sl 14:53 0:00 /usr/sbin/apache2 -k start ubuntu 6874 0.0 0.0 12948 948 pts/0 S+ 15:07 0:00 grep -E --color=auto (apache|httpd)
So I know my server is owned by www-data - even performing sudo chgrp changes such as ubuntu:www-data had no effect.
I had the same problem in local environment. On production, my blade template is practically rendered as raw text content as opposed to displaying the Laravel error page - assuming it's because the bootstrap/cache (which I've also modified permissions and ownership for) is being unable to be written to/partially written to.
I've also noted that a lot of tutorials mention bootstrap/cache being within the /storage folder but in newer Laravel versions this seems to have moved to /project-directory/bootstrap as opposed to /project-directory/storage/bootstrap etc.
I'm running Ubuntu Xenial 16.04 on an Amazon AWS instance.
Any help would be thoroughly appreciated.
drwxr-xr-x root root / drwxr-xr-x root root var drwxr-xr-x root root www drwxr-xr-x root root html drwxrwxr-x www-data www-data flexischedule drwxrwxr-x ubuntu www-data storage drwxrwxr-x ubuntu www-data logs
I've switched between ubuntu and www-data as the owner and still nothing. Sorry the format is not great in comments – logikurlchmod -R 775 storage chmod 775 bootstrap/cache chown -R www-data ./
– Bartpublic/index.php
contents to<?php phpinfo();
If it is not rendering php info page, then you need check tutorials on how to properly install and setup apache with php on your server... – Bart