What are the differences between Apache module and (Fast)CGI in PHP?
The main difference between Apache module and (Fast)CGI in PHP is how they handle PHP scripts. Apache module runs PHP scripts as part of the web server process, which can improve performance but may lead to stability issues. On the other hand, (Fast)CGI runs PHP scripts as separate processes, which can be more stable but may have slightly lower performance.
// Apache module configuration
<IfModule mod_php.c>
AddHandler application/x-httpd-php .php
PHPIniDir "/path/to/php.ini"
</IfModule>
// (Fast)CGI configuration
<IfModule mod_fcgid.c>
AddHandler fcgid-script .php
FcgidWrapper "/path/to/php-cgi" .php
</IfModule>