Can modules be loaded and not show up on a phpinfo() page?

3.7k Views Asked by At

enter image description hereThere is a phpinfo() page in our test environment that displays a heading Loaded Modules and shows all of the modules that are loaded. A duplicate phpinfo() page on the live site does not have a Loaded Modules section and some modules that handle things like GZIP compression appear as though they are not loaded. Linux guy says that the modules in question (mod_headers, mod_deflate and mod_expires) are in the LoadModule statement.

I would like GZIP Compression to be enabled for this site. Through .htaccess I have succeeded turning on GZIP compression with other sites and other servers but not on this site/server. Because no loaded modules are being displayed on phpinfo(), I am trying to determine, can modules be loaded and not show up on a phpinfo() page?

PHP version is 5.6.30

2

There are 2 best solutions below

0
B6431 On BEST ANSWER

Yes, if PHP is running on Apache as CGI or FastCGI. If PHP is running on Apache as a module, the answer would be no. Thanks to this post: Alternatives to apache_get_modules() to get list of loaded apache modules

2
jcabrera On

For anyone looking for another answer to this (as I was):

If you see that "php -m" has the module loaded, and your phpinfo() page shows the right php.ini file being loaded, but the new module still doesn't show in the list, this might be useful:

If you are using The PHP FastCGI Process Manager (Some Linux distros will have it on by default when installing the Web Server and PHP), you will need to restart/reload not only Apache, but ALSO the FPM (php-fpm):

sudo systemctl reload httpd
sudo systemctl reload php-fpm

After this, the phpinfo() page you had created, will correctly show the new modules added (FPM is serving the page with the new module loaded)