[cgiwrap-users] a php-cgiwrap method?
Brought to you by:
nneul
From: Jeff B. <soi...@sg...> - 2002-09-10 21:02:55
|
I've come up with a simple method of using the new php-cgiwrap in such a way to wrap php in such a way that the scripts can be put in the main web tree.. this is what i do: I compile cgiwrap twice... the first time for cgi scripts and the second time for php... like this: 1) for cgi #./configure \ > --with-httpd-user=apache \ > --with-install-dir=/path-to-root-apache/cgi-sys \ # make # make install 2) then i recompile for php (php was compiled as binary into /usr/local/bin with --enable-discard-path) # make clean #./configure \ > --with-httpd-user=apache \ > --with-install-dir=/tmp \ > --with-cgi-dir=public_html \ > --with-php=/usr/local/bin/php \ > --with-php-cgiwrap # make # make install 3) then I copy the cgiwrap executable compile for php into the cgi-sys folder as 'php-cgiwrap' and link php-cgiwrapd to it: # cp /tmp/cgiwrap /path-to-root-apache/cgi-sys/php-cgiwrap # ln php-cgiwrap php-cgiwrapd 4) then in each of my vhost defs i add these directives AddHandler php-cgiwrap .php Action php-cgiwrap /cgi-sys/php-cgiwrap/USERNAME where USERNAME is the username of the vhost owner. and also note that 'cgi-sys' is my new system "cgi-bin"... i just replaced the cgi-bin stuff for the main server in httpd.conf with cgi-sys. What this does is allow them to put their php scripts in the web tree and still have them wrapped without the #!/usr/local/bin/php (thanks Piotr and Nathan for building this in) line. As I'm definitely no expert in this I have no idea if there is a more elegant way to do this. If this is the best way then I wish we could build it into the compile sequence with a new compile option of: --with-php-script-dir = that would define the php script path separately from the cgi scripts. But it would have to create two executables... cgiwrap and php-cgiwap instead of just the one cgiwrap... If it's not then would you please clue me in? Thanks, Jeff |