0

I have read all the other questions concerning this, but my case is different.

I do have a local NAS filesystem which is mounted to linux (Ubuntu 14.04 server).

If I run a file_exists() with a prior clearcachestat() after some manual moving of files, it will produce wrong results until I restart linux.

A restart of the apache is not working, I have to do a complete restart.

I do not have memcached or APC installed.

Any ideas why clearcachestat is not working?

Where else could it be cached?

user229044
  • 232,980
  • 40
  • 330
  • 338
gb5256
  • 191
  • 11
  • 2
    Check at the command line. `stat` works there too e.g. `$ stat /path/to/file/on/nas`, and see what comes up. if the command line reports wrong results too, then you're hosed - the system itself isn't reporting correct info and there's nothing you can do in PHP to fix that. – Marc B Nov 12 '14 at 15:16
  • @Marc B: the command line stat brings back correctly that the file does not exist. PHP says that it does.... – gb5256 Nov 12 '14 at 15:27
  • 1
    then try running your script in CLI mode in php. eliminate apache from the mix. – Marc B Nov 12 '14 at 16:33
  • @Marc B: Thanks for helping me on this one... I did a php -r 'echo file_exists("/patch...); I returns correct values. So I assume now from your previous statement that it has to do with the apache.... – gb5256 Nov 12 '14 at 21:09

1 Answers1

0

I think I know where the problem comes from: As said in my question I do some manual moves of files (via OSX). I just checked what happens if I let PHP move the files. That works as expected. I then tried to move files via FTP, that works too and file_exist returns the values correctly. So I now returned to my "manual move of files" which I did on OSX by drag and drop files on the same mounted drive via Finder. And there is the problem: If I do a copy/paste and then delete original file from the filesystem, all is fine. But drag and drop on OSX 10.10 it obviously something different, because then the file_exist is not working. I can live with this right now, just avoiding drag and drop on that drive. But of course this does not solve the problem. As I have now proven that this has nothing to do with php or clearstatcache, this answer can be closed. I will reopen a new question about this drag and drop behaviour on OSX. Thanks Marc B for helping...

gb5256
  • 191
  • 11