We have a site that's performing very slowly. I have a suspicion that it's php-fpm configs, but rather than play with it if it's not the issue, I want to do performance tests first.
So I cloned one of our load balancer production VMs and want to remove php-fpm but not sure how.
CentOS 7.6, httpd 2.4.38, php7.2
Stopping the php-fpm obviously does nothing but break it. Moving the file /etc/httpd/conf.d/php-fpm.conf just stops all interpretation of PHP files, so how I do get it back to mod_php?
EDIT:
1) Installed mod_php72u.x86_64
2) Added a php.conf
file in /etc/httpd/conf.d/
with the following contents:
#
# The following lines prevent .user.ini files from being viewed by Web clients.
#
<Files ".user.ini">
Require all denied
</Files>
#
# Allow php to handle Multiviews
#
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
# mod_php options
#
<IfModule mod_php7.c>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
<FilesMatch \.(php|phar)$>
SetHandler application/x-httpd-php
</FilesMatch>
#
# Uncomment the following lines to allow PHP to pretty-print .phps
# files as PHP source code:
#
#<FilesMatch \.phps$>
# SetHandler application/x-httpd-php-source
#</FilesMatch>
#
# Apache specific PHP configuration options
# those can be override in each configured vhost
#
php_value session.save_handler "files"
php_value session.save_path "/var/lib/php/mod_php/session"
php_value soap.wsdl_cache_dir "/var/lib/php/mod_php/wsdlcache"
#php_value opcache.file_cache "/var/lib/php/mod_php/opcache"
</IfModule>
Best Answer
To get back, it's quite simple:
1) Uninstall php-fpm or stop it:
OR
2) Install mod_php again
3) Configure which listener httpd will use. The configuration file shows that prefork must be used
/etc/httpd/conf.modules.d/15-php.conf
contains this:In
/etc/httpd/conf.modules.d/00-mpm.conf
comment outand open up
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
4) Restart Apache/httpd
Spoiler alert: from brief testing it wasn't php-fpm so now I have to figure out what's actually causing the slowness.