RE: [cgiwrap-users] trying to emulate a nice php-cgiwrap install...
Brought to you by:
nneul
From: jeff b. <soi...@sg...> - 2002-04-29 22:37:39
|
heh, the parsing error was due to a stupid mistake... --enable-discard-path was used but I wasn't taking the php binary out of the web folders... doh! Well I seem to have it working by doing this: 1) patch cgiwrap with Piotr Klaban's patch for php 2) compile cgiwrap... once for .cgi's # ./configure --with-httpd-user=apache \ --with-local-contact-email=<...> \ --with-local-doc-url=<...> \ --with-install-dir= /var/www/cgi-sys --with-cgi-dir=<root cgi-bin for users, eg. =public_html/cgi-bin # make # make install 3) compile cgiwrap... 2nd for .php's # ./configure --with-httpd-user=apache \ --with-local-contact-email=<...> \ --with-local-doc-url=<...> \ --with-install-dir= /tmp \ --with-cgi-dir=<root html folder for users, eg. =public_html> # make # make install 4) copy cgiwrap from cgiwrap from /tmp over php-cgiwrap in /var/www/cgi-sys and relink php-cgiwrapd to php-cgiwrap # cp /tmp/cgiwrap /var/www/cgi-sys/php-cgiwrap # rm -f php-cgiwrapd # ln php-cgiwrap php-cgiwrapd 5) compiled php and copied the binary to the user's cgi-bin as php4-12.cgi 6) confs: Then in my main apache conf I added: ScriptAlias /cgi-sys/ /var/www/cgi-sys/ And in my virtual hosts conf I put: Action php-cgiwrap /cgi-sys/php-cgiwrap/username/cgi-bin/php4-12.cgi AddType php-cgiwrap .php .php3 .php4 .phtml 7) usage: cgi scripts (exist in cgi-bin): http://virt-domain.com/cgi-sys/cgiwrap/username/script.cgi php files (exist in html folders, not cgi-bin) http://virt-domain.com/file.php and the php file is wrapped and doesn't have the #!/path-to-php/ in it. and it seems to work. Let me know if you see any glaring mistakes I'm making... thanks. (ps, thanks to Piotr and shimi for their help on the outside of this group) Jeff > -----Original Message----- > From: cgi...@li... > [mailto:cgi...@li...]On Behalf Of jeff bert > Sent: Saturday, April 27, 2002 5:04 PM > To: cgi...@li... > Subject: [cgiwrap-users] trying to emulate a nice php-cgiwrap install... > > > 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 > > > > _______________________________________________ > cgiwrap-users mailing list > cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgiwrap-users > |