Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: Sam Edge To: cygwin AT cygwin DOT com Subject: Cygwin/Apache with PHP CGI Date: Fri, 10 May 2002 03:56:49 +0100 Organization: . Reply-To: cygwin AT cygwin DOT com Message-ID: References: <01ufduo7c330fgmratp0qgfrgqkdv7upa8 AT 4ax DOT com> <3CD92533 DOT 9B0A0147 AT wapme-systems DOT de> <71hidu8lr0qssqnne37377r6aac6t40l8n AT 4ax DOT com> <3CDA53EC DOT D3866B26 AT wapme-systems DOT de> <88dldugtt8sfdql1r3inb85uq47frqnuqu AT 4ax DOT com> <27uldusi9241b01mgf37qocmsq6k71hud4 AT 4ax DOT com> In-Reply-To: <27uldusi9241b01mgf37qocmsq6k71hud4@4ax.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g4A2vCr08796 Further to my problems with the Apache PHP module package I've given up for the moment. Instead I've downloaded the latest 4.2.0 Win32 native PHP ZIP file and unzipped this into its own directory. I've then made sure php-cli.exe, sapi\php.exe and php4ts.dll are in my Windows PATH and copied php.ini-recommended to C:\WINNT\php.ini to get the command line PHP working. Finally, to use this from Cygwin/Apache I've commented out the PHP LoadModule and AddModule lines and created a cgi-bin shell script to run PHP via an Action line in htppd.conf. httpd.conf: ... #LoadModule php4_module lib/apache/libphp4.dll ... #AddModule mod_php4.c ... AddType application/x-httpd-php .php Action application/x-httpd-php "/cgi-bin/php-cgi" ... /var/www/cgi-bin/php-cgi: (or wherever your cgi-bin actually lives) #!/bin/sh export PATH="/bin:$PATH" win_page=`cygpath -w "$PATH_TRANSLATED"` export PATH_TRANSLATED="$win_page" php 2>&1 The crucial bit is converting PATH_TRANSLATED from Cygwin/Posix format to Windows native for PHP.EXE to read. Your PHP script will have to be written with the Windows native filing system in mind so there are a few other variables that might benefit from translation too if your script uses them. Cygwin is automatically translating PATH but DOCUMENT_ROOT and SCRIPT_FILENAME might be needed too. (Although I can't think why.) (I appreciate that CGI is a sub-optimal way of using PHP in Apache but at least this /is/ working for me and allows me to check my code more easily before uploading to my service provider's Apache/PHP server.) -- Sam Edge -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/