Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to override PHP configuration when running in CGI mode
    text
    copied!<p>There are some tutorials out there telling me how to override PHP configuration when it is running in CGI mode. But I'm still confused because lots of them assume that the server is running on Linux. While I need to do that <strong>also</strong> on Windows.</p> <p>My hosting is indeed using Linux but my local development computer is using Windows XP with Xampp 1.7.3. So I need to do that in my local computer first, then I want to change the configuration on hosting server.</p> <p>The PHP in my hosting server is already run as CGI while in my local computer still run as Apache module.</p> <p>At this point, the processes that I understand are:</p> <ol> <li><p>Change PHP to work in CGI mode. I did this by commenting these two line in "httpd-xampp.conf":</p> <blockquote> <p><code># LoadFile "C:/xampp/php/php5ts.dll"</code><br/> <code># LoadModule php5_module modules/php5apache2_2.dll</code></p> </blockquote></li> <li><p>My PHP is now running as CGI. I checked this with phpinfo(). It tells me that the Server API is now CGI/FastCGI. Now I want to override php configuration.</p></li> <li><p>Create "cgi-bin" directory in DocumentRoot. My DocumentRoot is in "D:\www\" (I'm using apache with virtual host). So it is now "D:\www\cgi-bin".</p></li> <li><p>Change the default "cgi-bin" directory settings from "C:/xampp/cgi-bin/" to "D:\www\cgi-bin":</p> <blockquote> <p><code>ScriptAlias /cgi-bin/ "D:/www/cgi-bin/"</code></p> <pre><code>&lt;Directory "D:\www\cgi-bin"&gt; Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI AllowOverride All Allow from All &lt;/Directory&gt; </code></pre> </blockquote></li> <li><p>Copy 'php.ini' file to "D:\www\cgi-bin" and modify upload_max_filesize setting from 128M to 10M.</p></li> <li><p>Create 'php.cgi' file in "D:\www\cgi-bin" and put these code inside the file:</p> <blockquote> <p><code>#!/bin/sh</code><br/> <code>/usr/local/cpanel/cgi-sys/php5 -c /home/user/public_html/cgi-bin/</code></p> </blockquote></li> </ol> <p>That's it. I'm stuck at this point. All of tutorials tell me to create 'php.cgi' file and put shell code inside the file.</p> <p>How to do the 6th step on Windows? I know the next step is to create handler in .htaccess file to load that 'php.cgi'.</p> <p>And also, because I will also need to change PHP configuration on my hosting server (Linux), is the 6th step above right? Some tutorial tells to insert these lines instead of above:</p> <pre><code>#!/bin/sh export PHPRC=/site/ini/1 exec /cgi-bin/php5.cgi </code></pre> <p>I'm sorry if my question is not clear. I'm a new member and this is my first question in this site.</p> <p>Thank you.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload