<div dir="ltr"><div class=""><div class=""><p>Hi all, <br></p><p>I'm a little stuck on an Apache configuration issue. I'm using Ubuntu as my server. <br></p><p><br></p>
<p>I am using PHP as an Apache module for most of my site (and that's
working great), but I have an application (mapserver) that needs to use PHP in CGI
mode. I'd like to use CGI just for the mapserver directory. </p>
<p>I'm using the php_sapi_name() function to determine how PHP is being served.</p>
<pre><code>print php_sapi_name();
<br><br><br></code></pre>
<p>With the PHP module disabled, PHP is served/interpreted correctly
with CGI. <br></p><p>If I enable the PHP Apache module it is served/interpreted
correctly with the Apache module. <br></p><p><br></p>
<p>So, I have both pieces working, I just can't figure out how to specify
which to use for a specific directory. Most of the search results I've
found assume that I don't have CGI working or that I wish to switch
between the two. </p>
<p>I tried disabling PHP in the specific directory, but then the PHP file is sent to the browser without being interpreted. </p>
<pre><code><Directory /path/to/cgi/application/>
php_admin_value engine Off
</Directory>
</code></pre>
<p>How can I tell Apache to serve PHP in /path/to/cgi/application/ using CGI?</p><p><br></p><p>Thanks,</p><p>Michael Moore<br></p>
</div>
</div></div>