Posted on 3rd September 2012 by JakeThere are multiple ways to execute PHP scripts on a web server. We’re often asked about the difference between these modes, so here it is!We offer the three most common PHP handlers across our range:. Apache module. CGI. FastCGIEach of these has its own advantages and disadvantages.Apache Module (modphp)Using modphp to execute PHP scripts on a web server is the most popular method used by our customers and until recently was the default mode we set when you create a new webspace.When using modphp the PHP interpreter is embedded in each Apache process that’s spawned on the server.
Once the newer version of PHP is installed on your server, It’s time to update the Apache configuration file to change the PHP version. Update PHP version in Apache config. If you followed our guide to set up Apache with PHP-FPM on your server, execute the following command to open the PHP-FPM and FastCGI configuration file in edit mode.
![Apache cgi example Apache cgi example](http://www.tutorialchip.com/wp-content/uploads/2010/12/WampServer-2-Setup-Wizard.jpg)
This way every Apache worker is able to handle and execute PHP scripts itself removing the need to deal with any external processes; unlike CGI or FastCGI. This makes it very useful for sites that are ‘PHP heavy’ where lots of requests are likely to contain PHP code (such as WordPress, Drupal, Joomla, etc.) because all the requests can be handled by Apache.As the interpreter is started along with Apache, it allows it to run very quickly as it can cache certain information and doesn’t need to repeat the same tasks each time a script is executed.The downside to this is that the footprint for each Apache process is larger as it requires more system resources with the PHP interpreter embedded.