Re: [cgiwrap-users] CGIWrap / PHP / override of variables
Brought to you by:
nneul
From: Tuc at T-B-O-H.N. <ml...@t-...> - 2007-05-02 04:00:14
|
> > On May 1, 2007, at 3:59 PM, Tuc at T-B-O-H wrote: > > Maybe I'm a bit slow, but are you saying that pretty much ANY > > php script and/or set of scripts I get from any source *IS NOT* > > going to run > > under CGIWRAP without modification? I can't see how if its using the > > No. I'm not sure how you got that interpretation, but no. At my > former employer we used to cgiwrap every user's CGI scripts, and > people installed PHP stuff all the time. > > On my own site, I have tested environments for drupal, joomla, > opensrs-php, and many other products installed and working under > cgiwrap without a single line of code being modified. > > It just works, and I never need to think about it. The only thing > which doesn't work is php statements in the .htaccess files as that > is a something only mod_php would have access to, and I've never > found anything that actually required that to work. > > If you compile cgiwrap pointing to the PHP interpreter, it just works. > Ok, being that I'm still not seeing how it would work I did the following... phpnocgiwrap.tucs-beachin-obx-house.com - 204.107.90.9 phpcgiwrap.tucs-beachin-obx-house.com - 204.107.90.10 Apache : <VirtualHost 204.107.90.9> ServerAdmin web...@ph... DocumentRoot /home/phpwrap Servername phpnocgiwrap.tucs-beachin-obx-house.com ErrorLog "|/usr/local/sbin/cronolog /usr/local/logs/%Y%m%d/phpnocgiwrap.error_lo g" TransferLog "|/usr/local/sbin/cronolog /usr/local/logs/%Y%m%d/phpnocgiwrap.acces s_log" UserDir disabled HostNameLookups off IdentityCheck off </VirtualHost> <VirtualHost 204.107.90.10> ServerAdmin web...@ph... DocumentRoot /home/phpwrap Servername phpcgiwrap.tucs-beachin-obx-house.com ErrorLog "|/usr/local/sbin/cronolog /usr/local/logs/%Y%m%d/phpcgiwrap.error_log" TransferLog "|/usr/local/sbin/cronolog /usr/local/logs/%Y%m%d/phpcgiwrap.access_ log" UserDir disabled HostNameLookups off IdentityCheck off Action phpcgi-wrapper /gcgi-bin/php-cgiwrap/phpwrap AddHandler phpcgi-wrapper .php <Location /gcgi-bin> SetEnv CGIWRAP_AUTH_VHOST "phpcgiwrap.tucs-beachin-obx-house.com" SetEnv CGIWRAP_REQUIRE_USER "phpwrap" </Location> </VirtualHost> User : vjofn# grep phpwrap /etc/passwd /etc/group /etc/passwd:phpwrap:*:1020:1020:PHP Wrap:/home/phpwrap:/usr/local/bin/zsh /etc/group:phpwrap:*:1020: Scripts : date.php ======== <html> <head> <title>Example #1 TDavid's Very First PHP Script ever!</title> </head> <? print(Date("l F d, Y")); ?> <body> </body> </html> lastmod.php =========== <html> <head> <title>Page last updated on month/date/year hour:min PHP Script</title> </head> <? $last_modified = filemtime("lastmod.php"); print("Last Modified "); print(date("m/j/y h:i", $last_modified)); ?> </body> </html> example.php ========== Ok, so I cheated. This is a package, but it was supposed to use mysql and I don't have the inclination to get it running, but it produces output none the less. cgiwrap-4.0 configure statement : ./configure --with-perl=/usr/bin/perl -with-install-dir=/usr/local/www/cgi-bin - -with-cgi-dir='' --with-httpd-user=www --with-logging-syslog='' --with-install-g roup=wheel --with-require-redirect-url --with-quiet-errors --with-vhost-overrid e --with-env-require-user --with-php=/usr/local/bin/php --with-php-interpreter --with-php-cgiwrap --with-cgiwrapd php_cli version: vjofn# /usr/local/bin/php -v PHP 4.4.4 with Suhosin-Patch 0.9.6 (cli) (built: Dec 12 2006 12:17:21) (DEBUG) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies RESULTS http://phpnocgiwrap.tucs-beachin-obx-house.com/date.php Tuesday May 01, 2007 http://phpnocgiwrap.tucs-beachin-obx-house.com/lastmod.php Last Modified 05/1/07 11:30 http://phpnocgiwrap.tucs-beachin-obx-house.com/example.php (Buncha mysql warnings) You are from: Your IP is: 69.249.95.230 You came from: Your came from search engine: Your language is en:English Your operating system is: Linux Your browser is called: Ok, fine..... http://phpcgiwrap.tucs-beachin-obx-house.com/date.php Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, web...@ph... and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/1.3.37 Server at phpcgiwrap.tucs-beachin-obx-house.com Port 80 (vjofn# tail /usr/local/logs/*0501/phpcgiwrap.err* [Tue May 1 23:55:19 2007] [error] [client 69.249.95.230] malformed header from script. Bad header=<html>: /usr/local/www/cgi-bin/php-cgiwrap) http://phpcgiwrap.tucs-beachin-obx-house.com/lastmod.php Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, web...@ph... and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/1.3.37 Server at phpcgiwrap.tucs-beachin-obx-house.com Port 80 (vjofn# tail /usr/local/logs/*0501/phpcgiwrap.err* [Tue May 1 23:55:19 2007] [error] [client 69.249.95.230] malformed header from script. Bad header=<html>: /usr/local/www/cgi-bin/php-cgiwrap [Tue May 1 23:56:24 2007] [error] [client 69.249.95.230] malformed header from script. Bad header=<html>: /usr/local/www/cgi-bin/php-cgiwrap) http://phpcgiwrap.tucs-beachin-obx-house.com/example.php (It made me download the results because it didn't understand them) SO.... What did I do wrong? Thanks, Tuc |