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.

Looking at phpinfo() I found a lot of modules that I am not using and therefore they just waste memory. So I want to remove them, but the problem is that also there is huge amount of info about 'how to install module X in php' I can not find anything about 'how to uninstall module X in php'.

Even when I tried to find and disable them in php.ini I got no luck. For example with bcmath module the only reference in php.ini is

[bcmath]
; Number of decimal digits for all bcmath functions.
; http://php.net/bcmath.scale
bcmath.scale = 0

which is just to change some parameter, not to disable it. Some of the answers I found tells to add functions here:

disable_functions =exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source

which is doing completely another thing.

So how can I remove (or in the worst case disable) a lot of modules in php, running on apache. The list of modules is kind of big (bcmath, bz2, zip, dba, pdo, ftp, gettext, sopa, simpleXML and so on ...)

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If the modules are dynamically loaded then you will find them either in php.ini or in some additional configuration files. If you look at a phpinfo result, you will see a parameter called 'Scan this dir for additional .ini files'. Look in that folder for any additional ini files that might be loading modules.

All the rest of the modules remaining are compiled into PHP so you will need to completely rebuild PHP in order to get rid of them. If you are using a RHEL like system, you can download the SRPM for PHP, edit the spec file to get rid of those modules and rebuild the RPM.

share|improve this answer
    
Is there an easy way to know if the module is compiled into PHP? Now reading your answer I assume that all of them are compiled, because I have not installed any of them. –  Salvador Dali Apr 13 at 9:41
    
If they are not loaded in an ini file then they are compiled in. –  Florin Asavoaie Apr 13 at 9:53

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.