Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.