[cgiwrap-users] trying to emulate a nice php-cgiwrap install...
Brought to you by:
nneul
From: jeff b. <soi...@sg...> - 2002-04-28 00:00:33
|
A friend of mine has his site hosted by a company that has a very nice php-cgiwrap setup. I'm trying to emulate it but can't figure out how they did it. This is how it works: PHP runs normally from their binary install unwrapped. However, if you want your scripts wrapped then you can compile your own php binary and put it in your cgi-bin. This is done with the options --enable-discard-path, --with-config-file-path=<local dir> and --enable-force-cgi-redirect at the minimum. Then you copy that php binary to your cgi-bin giving it the .cgi extension. Then in the folders where you want the php wrapped you add .htaccess files with: Action application/x-httpd-phpx /cgi-sys/php-cgiwrap/USERNAME/php.cgi AddType application/x-httpd-phpx .php <etc> Then you can call your scripts normally from any folder (governed by the .htaccess file) and they don't have to have the #!<path-to-php> in them nor do they have to be in the cgi-bin and yet they are wrapped. I've been trying to emulate this on my server and think I have a few of the components down but obviously not all as it's not working yet. This is what I've done: 1) patched cgiwrap-3.7.1 source with the php patch by Piotr Klaban (http://www.klaban.torun.pl/patches/cgiwrap/) 2) compiled my own php with the following options: ./configure --without-gd \ --with-zlib \ --without-mysql \ --with-config-file-path=/home \ --disable-debug \ --enable-track-vars \ --enable-ftp \ --enable-force-cgi-redirect \ --enable-discard-path 3) make (php) 4) copied php.ini-dist into /home/php.ini and php into /home/USERNAME/public_html/cgi-bin/php.cgi 5) compiled cgiwrap-3.7.1 with: ./configure --with-httpd-user=apache \ --with-local-doc-url=<mydocs> \ --with-local-contact-email=root@localhost \ --with-install-dir=/var/www/cgi-sys \ --with-php=/home/USERNAME/public_html/cgi-bin/php.cgi 6) make, make install (cgiwrap) 7) added the .htaccess file in the root of the USERNAME's webserver of: Action application/x-httpd-phpx /cgi-sys/php-cgiwrap/USERNAME/php.cgi AddType application/x-httpd-phpx .php .php3 .php4 .phtml After doing all that I test my cgiwrap stuff on .cgi files and there's no problems. But when I test it on php stuff I get the following parse errors on a php file that only has <?php phpinfo(); ?> in it: ----------------- Warning: Unexpected character in input: '' (ASCII=4) state=1 in /home/USERNAME/public_html/cgi-bin/php4-12.cgi on line 2851 Warning: Unexpected character in input: ' in /home/USERNAME/public_html/cgi-bin/php4-12.cgi on line 2852 Warning: Unexpected character in input: '' (ASCII=4) state=1 in /home/USERNAME/public_html/cgi-bin/php4-12.cgi on line 2852 Warning: Unexpected character in input: '' (ASCII=4) state=1 in /home/USERNAME/public_html/cgi-bin/php4-12.cgi on line 2853 Warning: Unexpected character in input: '' (ASCII=27) state=1 in /home/USERNAME/public_html/cgi-bin/php4-12.cgi on line 2854 Parse error: parse error in /home/USERNAME/public_html/cgi-bin/php4-12.cgi on line 2854 ----------------- Any ideas what I'm doing wrong? I know this seems more like a php question but i'm hoping someone in cgiwrap-users has come up against this and can help since it is a problem created by trying to wrap php in a special way. Thanks, Jeff |