Warning: touch(): Utime failed: Permission denied

php, touch

Solution

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`.

Problem

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!

Original source