Should I use mod_php or PHP-FPM for WordPress on Apache2?

I'm setting up an instance with PHP 7 and Apache2 on Ubuntu 16.04 to run a WordPress site, and trying to make sure it will be optimized. I read that PHP-FPM might perform better than the default mod_php. Is this true and worth exploring? And, if so, are there any tutorials on how to set this up in my environment?

I tried some PHP-FPM tutorials out there, but I keep getting errors when trying to restart Apache2.

Thanks.

5 Replies

If you could provide the exact error you see it could help us find what's going on.

How much traffic do you expect for this site? How many servers/infrastructure setup do you plan on using?

My first thought, unless you can take advantage of the features PHP-FPM will give you, you should stick with modPHP since it's easier.

That's what I use, also, with mod_php. With both, I can completely isolate user accounts and virtual hosts from each other, which provides more security than other methods, in my opinion. My setup prevents one user from even reading the home directory to list other possible user accounts, so they couldn't get into others folders. It seems fast enough, and only uses about the same memory as the prefork mpm.

I'll second mpm-itk as well.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct