My server is pretty straightforward. Centos, PHP, Nginx, Apache, etc. Two days ago I started getting an error in my logs that it could not find a file that was there plain as day. After I deleted, then replaced the file, and restarted Apache things worked.
Today I started getting an error that it couldn’t find a PHP function in a class that extended another class. I renamed both files to old, then uploaded the original file and things started working again.
Permissions do not appear to have been changed and neither has the ownership changed.
These files in question haven’t been update/touched in months.
Looking for ideas as to what might be going on.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey,
From what you’re describing, it sounds like you’re experiencing a rather peculiar issue. Files and functions “disappearing” or becoming “unrecognized” despite being present and unchanged for months can indeed be baffling. Given the stack you’re working with (CentOS, PHP, Nginx, Apache), there are a few areas we can explore to troubleshoot this issue:
OPcache Issues: OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thus eliminating the need for PHP to load and parse scripts on each request. However, if there are issues with the cache, it could lead to PHP not recognizing changes to files or, in rare cases, functions. Clearing the OPcache (
opcache_reset();
) or temporarily disabling it could help determine if this is the cause. This might also be related to the available RAM on the server.Inodes Running Out: If your server is running out of inodes, it could lead to strange filesystem behavior, including the inability to recognize existing files. You can check inode usage with
df -i
. Here is a guide on how to check your disk usage as well:Let me know how it goes!
Best,
Bobby