CGI SquirrelMail Readme This is a script to convert SquirrelMail from regular PHP to PHP running as CGI. Normally, a webserver has one instance of PHP running. This one instance sits there, and when somebody visits a .php page, it takes in that .php file, and spits out a webpage. For various reasons, some people don't want to have their PHP scripts executed in that manner. These people have to run PHP as CGI. To do this, you add a shebang line to the beginning of your PHP scripts, and tell your webserver to run PHP as CGI (via an AddHandler in the .htaccess file). This script does that, and a couple other things. Namely, this script will: 1. rename /index.php to /index.cgi, so that it is also executed as CGI. 2. add a PHP shebang line to all files in /src/, and to /index.cgi 3. chmod all of the files in /src/, and /index.cgi to 0700, since that's all that's needed for CGI that the owner is executing 4. add an .htaccess in SM's /src/ directory, so that the files within will be executed as CGI Explanations: Step 1 - we don't want a root-level .htaccess adding PHP as a CGI handler, since this would apply to all subdirectories, and we'd have to go in and remove the includes as handlers. Step 2 - the files in /src/ and /index.cgi are the page-serving scripts. This was written by John Marriott . Email with any questions/suggestions. This is free software, released under the BSD license: Copyright (c) 2004, John Marriott All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.