I know this question has been asked several times before, but none of the solutions given seem to have helped.
Can you please help me understand what I’m doing wrong?
Here’s my environment: OS: Fedora Workstation 41 Kirby Installation method: Kirby CLI using PlainKit Web Server: nginx Installation Directory: /var/www/sites/hometownweb (hometownweb is the root/base of the install)
The directory sites all the way down is owned by nginx:nginx
The directory sites has permissions 775
The directory hometownweb all the way down is set to 777 (I would never do this in production, but I’m getting frustrated with it not working).
So when you are running your site locally, what processes are involved and what users are running those processes?
I think with Nginx you get at process for nginx and one or maybe several processes for php(or php-fpm maybe)? Are they all running with the nginx user?
As long as no user exists, you will need to do the installation, which consists of creating the first user. If you are on a remote server, you need to allow this first in your config. On a local server, it should be no problem.
But if you get an error message that the sessions folder is not writable, then you need to fix that first.
And before it’s asked, I know it’s not a “legit” domain name (FQDN), but I have my /etc/hosts file listening for hometownweb and directing to 127.0.0.1, and nginx config file listening for hometownweb
Can you try to do a reduced test where you call is_writable($path_to_sessions_folder) (with the correct path as a string) without going through Kirby code at all? You can do that by editing your site’s index.php and commenting out all Kirby code including requires.
<?php
$path_to_sessions_folder = "/var/www/sites/hometownweb/site/sessions";
var_dump(is_writable($path_to_sessions_folder));
exit; // stops execution here
require 'kirby/bootstrap.php';
echo (new Kirby)->render();
It might also be worth checking, in the FileSessionStore constructor, what the values of $path and $this->path are (especially since one of those values is used in the error message, but it’s the other one that is actually checked). You can do that by adding some var_dump calls in kirby/src/Session/FileSessionStore.php.
I’d also check the PHP configuration and make sure all error reporting is turned on:
First off, thank you to everyone for taking the time to try to help me. I really appreciate it.
error_reporting was (and still is) set to: E_ALL & ~E_DEPRECATED & ~E_STRICT display_errors was set to Off, now set to On display_startup_errors was set to Off, now set to On
After changing the two settings, I restarted both nginx and php-fpm.
Here is the is_writable in the index file along with the browser output:
So I think this confirms that it’s not a Kirby-specific problem, but rather a problem with your local server and PHP setup that results in this folder not being writable.
Dunno what else to suggest, aside from checking everything from folder permissions to PHP configuration to Nginx & fastcgi configuration. There must be some access rule at one of the execution levels that prevents writing to disk (to this specific folder or maybe even to any folder).