I am writing the session to a temporary file as follows:
if ($_SESSION['user_login_status'] == 1)
{
touch("tmp/access-" . session_id());
}
I have the following permissions set on tmp just to test it is working (I will modify permissions to be more restrictive as I test):
drwxrwxrwx+
I receive the following error:
Warning: touch(): Utime failed: Permission denied
Any thoughts? Everything I have googled thus far says check the permissions (done) or is related to a wordpress error which I am not running. Thanks!
I ran into the error and just removed the underlying files and the error went away...
It seems that the permissions on the directory are not the problem, rather the "access-" . session_id() seems to already exist and it's permissions are so that the PHP process can't change it's Utime. Check if the file "access-" . session_id() exist, if so remove it and run the script. If you do not receive an error check if the file "access-" . session_id() was created and what it's permissions are. If they are not correct try to chmod the file directly after creating it with touch.
I had the same error message show up (but a different code snippet). What solved it for me was to change the owner for the file, i.e. chown uname:uname filename
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With