I manage a server (running Ubuntu) which hosts our client's sites with a few dozen different PHP-based websites, mostly small sites but also some installations of CMSes and forums.
I used the get_loaded_extensions()
method to see what extensions I have loaded. To help streamline the server (remove unnecessary extensions to make upgrading easier and marginally improve speed), I'd like to remove extensions that aren't being used by any of the sites.
I currently have 54 different extensions loaded.
I can easily eliminate some of these from the list which I know are used, but others I am less sure about. Is there some way that I can see extensions which have not been used recently?
I did a search and found this which appears to scan files in a listed directory and all subdirectories for extension use within files and then compare this to the extensions loaded by PHP. I would definitely give this a try as it appears to do exactly what you want.
Other than that, I do not think that PHP internally keeps track of the last time an extension that was loaded was used by a script, it would probably add an unacceptable overhead for them to do it, especially on high traffic servers.