As a developer sometimes we not only need to do coding, but tweak server settings also. We should know the ways on how to change configuration settings like in apache how to enable mod_header module. Or how to increase LimitRequestBody in apache. Here is one of them trick to show you how to check which modules are enabled in apache.
1. From terminal
Apache modules list can be found from terminal. Below is a code, just copy and paste it in terminal. And you will get screen like below image.
If you are on debian based system, above command won’t work. Try below command.
Output should be like this.
2. From phpinfo()
Create an blank file on your server anywhere (on root is recommended), name it anything which others can’t guess. like, sdfssfes.php , 23egstesf.php.
You should be thinking why I told to name file like this. It’s because we are going to print our php information, so this should be confidential for security purpose.
- Read What security problems could come from exposing phpinfo() to end users? on stackoverflow.
put below code in that file.
<?php phpinfo(); ?>
and save it. Now run this file from browser.
You will get all php informations. Search for ‘Apache2handler’. There will be table and in that find column “Loaded Modules”. It is list of all apache modules. See below screenshot.