After making a patch for eZ to work with lighttpd/fastcgi, I thought it should be also possible to make eZ publish work with Apache CGI mode (I am still using apache1.3.34).

 

I have to re-emerge php with added cgi use flag to get cgi binary. The configuration necessary for apache to use PHP as CGI is stated in gentoo documentation:

<IfDefine PHP4CGI>
    ScriptAlias /php4-cgi /usr/lib/php4/bin/php-cgi
    Action php4-cgi /php4-cgi
    AddHandler php4-cgi .php4 .php3 .php .phtml
</IfDefine>

I save that as file /etc/apache/modules.d/71_cgi_php.conf and I have to change one option in file /etc/conf.d/apache from: APACHE_OPTS="-D PHP4" to APACHE_OPTS="-D PHP4CGI"

One option in php.ini is also required to be set: cgi.fix_pathinfo=1. Without this option enabled, you will receive an error message telling you that " 'unexpected T_STRING' in the php binary" (it may appear in log instead/as well).

On the other hand, lighttpd does not require this option to be enabled.