Don't Use CGI

You have two options when installing PHP: use it as a CGI executable, or use it as an Apache/ISAPI module. Although there are advantages to both options, running PHP as a module is overwhelmingly favorable when it comes to performance, as all of PHP and its extension modules reside in memory as opposed to being loaded with every request.

From a purely performance-motivated point of view, you would be crazy to run PHP as a CGI executable.

Get PHP in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.