Well, the latter is a matter of opinion, but I'll take it under advisement. If you look at how much file activity a typical Wordpress site does, even with a database underlying it, you'll see why I say that. A typical busy commercial site can easily have multiple thousands of text and image files.
A little history: I never expected this system to be as heavily used as it has been. I was expecting maybe 20-30 purchase orders in a really heavy month; in the year that it has been in operation, the count is now over 1,000(!). I'm working on a complete rewrite that will use MariaDB to make it easier to do searches and changes. The problem is, I need this to work in the interim while I try to bring the New Improved version online!
Anyway, the plot thickens. I don't think it's PHP, I think it's something underlying that. Maybe even the OS. As proof, I wrote a Python program to re-index the files. A "cat" dump in a terminal shows the very same files missing. Same numbers, same span. One final puzzle is that my home server (OpenSuse) uses Btrfs, and the RHEL server at work uses XFS. Hard to blame it on the file system ...
Thanks for the replies. You've given me some pointers. If I figure it out, I'll come back and post a detailed answer in case anyone else runs across something like this.
BTW -- I did a bunch of Googlin' before I came here, and I saw some of those PHP bugs that you mentioned. But I really don't think they apply here, not if Python is experiencing the same thing.