Can't write to /tmp with php, despite 777 permissions and no open_basedir value
问题 I'm trying to write a file to my /tmp directory (on an apache server) with the php fopen function, but it fails: <?php $handle = fopen("/tmp/test.txt", "x"); if ($handle) echo "Success!"; else print_r(error_get_last()); This returns the error message: failed to open stream: No such file or directory. The /tmp directory has permissions set to drwxrwxrwt and I can see that the web user is writing other files to it. Mysteriously, if I point the script to another folder with permissions 777 , it