That explains it. Nginx runs by default under www-data
; chown the files to that user. No user can modify or write files or in directories belonging to root.
Directorys are not writable.
- Edited
[root@server www]# chown -R www-data:www-data *
chown: invalid user: ‘www-data:www-data’
And never, ever set access rights to 777, unless you want your site to get hacked. (This is a very common reason sites get hacked on shared environments). The last 7 indicates everyone can write; this also allows a bad script on someone elses site to do naughty things
@luceos yes however I'm just testing locally.
- Edited
BlameDylan ah, it could also be www-run; check your /etc/nginx/nginx.conf
at the top i think
- Edited
...
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
...
Another thing: there is nothing in the views directory, wouldn't that be the problem?
Ok, chown to nginx
BlameDylan there is nothing in the views directory, wouldn't that be the problem?
Yeah, that is weird. There should be files.
BlameDylan it doesn't matter. it needs to create caches and stuff, you can't even write a log file now. Let alone create an error page using a error blade file.
I know you said you are running everything as ROOT and I know you said this is only a local install. Please keep in mind that depending on which linux distro you are using, there may be some underlying security preventing you from doing what you are doing.
It is better you run your test in the correct manner you would for a live install.
- Edited
BlameDylan Once you do a recursive chmod all bets are off. I'd suggest wiping the install and re extracting.
- Edited
@Kulga alright, just reinstalled. Everything is owned by the Nginx user with no permissions modified.
Additionally, I set my php.ini to display errors, and this is what I get:
Warning: file_put_contents(/var/www/sub.website.com/flarum/storage/framework/views/bb70210d87a252556c175ac77e7b5232): failed to open stream: Permission denied in /var/www/sub.website.com/flarum/vendor/illuminate/filesystem/Filesystem.php on line 81
Warning: file_put_contents(/var/www/sub.website.com/flarum/storage/framework/views/f8aebd3f27d63d7f2545b724c2ea9039): failed to open stream: Permission denied in /var/www/sub.website.com/flarum/vendor/illuminate/filesystem/Filesystem.php on line 81
Warning: include(/var/www/sub.website.com/flarum/storage/framework/views/f8aebd3f27d63d7f2545b724c2ea9039): failed to open stream: No such file or directory in /var/www/sub.website.com/flarum/vendor/illuminate/view/Engines/PhpEngine.php on line 42
Warning: include(): Failed opening '/var/www/sub.website.com/flarum/storage/framework/views/f8aebd3f27d63d7f2545b724c2ea9039' for inclusion (include_path='/etc/php.d') in /var/www/sub.website.com/flarum/vendor/illuminate/view/Engines/PhpEngine.php on line 42
BlameDylan When you say blank page, is it blank all except for the forum title?
This for example https://github.com/flarum/core/issues/410
Since I modified display_errors in my php.ini, I get the error messages above.
- Edited
@Dominion @Toby I tried with the Beta 2 and I still get an error. See attached screenshot:
The commands I ran were:
chmod 0755 /var/www/sub.domain.com
chmod -R 0755 /var/www/sub.domain.com/assets
chmod -R 0755 /var/www/sub.domain.com/extensions
chmod -R 0755 /var/www/sub.domain.com/flarum/storage
They all returned successful. Any ideas?
- Edited
BlameDylan who owns the files? If it's not writeable by the webserver, then it's not writeable.
0755 isn't a arbitary number. It means (in order)
- No special bit
- Owner of files may read, write, execute
- Group of files may read and execute
- Everyone else may read and execute
If you have the group of the files be the webserver and change permissions to 0775 or change the owner of the files to the webserver, either should fix that.
Kulga
It is owned by nginx, the Nginx web-server user defined in the nginx.conf
file.