0

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

B6431
  • 317
  • 1
  • 4
  • 13
  • do you know that apache and php has different modules? apache modules are not displayed in php of course – Iłya Bursov Apr 21 '17 at 16:55
  • @Lashane are you saying that mod_headers, mod_deflate and mod_expires are not Apache modules? – B6431 Apr 21 '17 at 18:00
  • these are apache ones, you will not see them in phpinfo modules output – Iłya Bursov Apr 21 '17 at 18:01
  • They are showing up in the phpinfo output in test but not on the live site. – B6431 Apr 21 '17 at 18:04
  • can you provide screenshot of test? – Iłya Bursov Apr 21 '17 at 18:04
  • The screenshot is from phpinfo() from the test site which also is Apache but slightly different from the live site. The phpinfo() from live does not have the bottom cells of this table. – B6431 Apr 21 '17 at 18:11
  • I was wrong, php can display apache modules, are you sure that you're using apache on prod? – Iłya Bursov Apr 21 '17 at 18:15
  • Yes. Not sure if it is CentOS though. I can find out if it helps but it is definitely Apache. – B6431 Apr 21 '17 at 18:18
  • ok, so these apache modules are not loaded in prod, right? – Iłya Bursov Apr 21 '17 at 18:21
  • I believe they are not. The Linux guy says that they are in the LoadModule statement. Just trying to figure out who's code is not working by way of a test. Was hoping phpinfo() could prove that the modules were not loaded. I defer to the experts on SO. – B6431 Apr 21 '17 at 18:25
  • If I could prove it, I could go to him and say something's not right on your end. – B6431 Apr 21 '17 at 18:26
  • 1
    according to http://php.net/manual/en/function.apache-get-modules.php php 5.0+ will show them, so they are not loaded – Iłya Bursov Apr 21 '17 at 18:26

2 Answers2

2

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)

jcabrera
  • 136
  • 5
1

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

Community
  • 1
  • 1
B6431
  • 317
  • 1
  • 4
  • 13