8

After reading this answer, I decided to change httpd's MPM on my server to worker. But while editing /etc/sysconfig/httpd, I noticed this comment:

# The default processing model (MPM) is the process-based
# 'prefork' model.  A thread-based model, 'worker', is also
# available, but does not work with some modules (such as PHP).
# The service must be stopped before changing this variable.
#
#HTTPD=/usr/sbin/httpd.worker

I may be interpreting it wrong, but isn't it telling me that worker will not work with mod_php? Because that is what I am currently using.

The server runs CentOS 6.4 and Apache 2.2.

jgillich
  • 445
  • 5
  • 10

2 Answers2

10

No - you can't - you'll have mysterious bugs and crashes as PHP isn't thread-safe.

But you can use worker-mpm for static files and something like php_fcgi or a reverse proxy to another httpd instance only for PHP.

I'm using the latter - it allows me to run multiple sites - all with different permissions and configs on CentOS 6.

Tometzky
  • 2,649
  • 4
  • 26
  • 32
0

As far as I know, mod_php is not thread-safe.

Matheus
  • 2,599
  • 1
  • 11
  • 4