Sunday 27 September 2020

touch(): Utime failed: Operation not permitted

I tried to run this command:

php -r "touch('/mnt/my_drive/test.txt', 1600981328);"

I got this error:

PHP Warning:  touch(): Utime failed: Operation not permitted in Command line code on line 1

If I run it with sudo, I don't get the error.

/mnt/my_drive is an NTFS drive. The mount was created in fsab with umask=000, so I have no idea, why do I get permission error.

Please do not mark this as a duplicate, because the similar questions have these answers:

  • Check the permissions: It should be right because of umask=000
  • Run composer/php in elevated mode: I would like to avoid running the webserver as admin
  • Modify some library files in vendor: I get this error even in command line, as my example shows
  • Don't use ntfs: It is not my choice


from touch(): Utime failed: Operation not permitted

No comments:

Post a Comment