Score:0

How do we stop using php-fpm on Apache?

cn flag

How do we stop using php-fpm on Apache? I tried to get a server running problem is it's running on CENTOS 6 and puppet only works on CENTOS 6. I was trying to figure out why the server wasn't running after I copied the settings and then I did:

sudo netstat -plnt

which showed me I was using php-fpm and on the server where it was working I wasn't running it. I was perplexed, because the httpd configs were the same last time I checked, so I am wondering how to switch from php-fpm to php to see if I can get Apache running on the new server. I turned it off:

sudo service php-fpm stop

But I am still getting 500 from varnish. I am not sure if I might have missed something in the httpd config, but the new and old server had pretty much the same configs.

I have a php.conf:

#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
  LoadModule php7_module modules/libphp7.so
</IfModule>

<IfModule !prefork.c>
  LoadModule php7_module modules/libphp7-zts.so
</IfModule>

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php7-script .php
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps

#
# 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/session"
php_value soap.wsdl_cache_dir  "/var/lib/php/wsdlcache"

and a fast_cgi conf:

# WARNING: this is a kludge:
## The User/Group for httpd need to be set before we can load mod_fastcgi,
## but /etc/httpd/conf.d/fastcgi.conf on RHEL gets loaded before
## /etc/httpd/conf/httpd.conf, so we need to set them here :(
## mod_fcgid does not have this bug,
## but it does not handle child PHP processes appropriately per
## http://serverfault.com/questions/303535/a-single-php-fastcgi-process-blocks-all-other-php-requests/305093#305093
User apache
Group apache

LoadModule fastcgi_module modules/mod_fastcgi.so

# dir for IPC socket files

FastCgiIpcDir /var/run/mod_fastcgi

# wrap all fastcgi script calls in suexec

FastCgiWrapper Off

# global FastCgiConfig can be overridden by FastCgiServer options in vhost config

FastCgiConfig -idle-timeout 120 -maxClassProcesses 1

# sample PHP config
# see /usr/share/doc/mod_fastcgi-2.4.6 for php-wrapper script
# don't forget to disable mod_php in /etc/httpd/conf.d/php.conf!
#
# to enable privilege separation, add a "SuexecUserGroup" directive
# and chown the php-wrapper script and parent directory accordingly
# see also http://www.brandonturner.net/blog/2009/07/fastcgi_with_php_opcode_cache/
#
#FastCgiServer /var/www/cgi-bin/php-wrapper
#AddHandler php-fastcgi .php
#Action php-fastcgi /cgi-bin/php-wrapper
#AddType application/x-httpd-php .php
#DirectoryIndex index.php
#
#<Location /cgi-bin/php-wrapper>
#    Order Deny,Allow
#    Deny from All
#    Allow from env=REDIRECT_STATUS
#    Options ExecCGI
#    SetHandler fastcgi-script
#</Location>

and a fcgi conf:

<IfModule mod_fastcgi.c>
    Alias /php5-fcgi-staging03 /usr/lib/cgi-bin/php5-fcgi-staging03
    FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi-staging03 -socket /var/run/php-fpm/php5-fcgi-staging03.sock -pass-header Authorization -idle-timeout 300
</IfModule>

Commenting out php5-fcgi-staging03 gives me:

Not Found
The requested URL /php5-fcgi-staging03/index.php was not found on this server.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.