Hacking with PHP has been updated for PHP 7 - click here! >>

Make sure you optimize Apache

Most people use PHP through Apache, and most of the remainder use it through Nginx. Regardless of which one you choose, make sure you're on the latest version – certainly nothing lower than 2.4 for Apache and 1.8 for Nginx.

You should also be aware there's a whole other world of optimization strategies for web servers, although it gets more complicated because many choices depend on your exact site configuration. For example, on my own sites that demand maximum responsiveness across many connections, I nearly always disable HTTP keep alives, because they just use up an extra Apache connection to save on page load time.


If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Optimising your SQL >>

Previous chapter: Avoid mod_access if you can

Jump to:


Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.