Admin-Ahead Community

Linux => General Linux => Topic started by: Aby on April 22, 2014, 10:32:50 pm

Title: Minimize Loadable PHP Modules (Dynamic Extensions)
Post by: Aby on April 22, 2014, 10:32:50 pm
Minimize Loadable PHP Modules (Dynamic Extensions)

PHP supports "Dynamic Extensions". By default, RHEL loads all the extension modules found in /etc/php.d/ directory. To enable or disable a particular module, just find the configuration file in /etc/php.d/ directory and comment the module name. You can also rename or delete module configuration file. For best PHP performance and security, you should only enable the extensions your webapps requires.

For example, to disable gd extension, type the following commands:
Code: [Select]
# cd /etc/php.d/
# mv gd.{ini,disable}
# /sbin/service httpd restart

To enable php module called gd, enter:

Code: [Select]
# mv gd.{disable,ini}
# /sbin/service httpd restart

-----