[cgiwrap-users] Using a different PHP with pre-existing cgiwrap?
Brought to you by:
nneul
|
From: Kent R. <in...@ke...> - 2010-03-13 20:22:05
|
I'm working on a shared host (with virtual hosting) that has cgiwrap installed. Trying to get the PHP scripts to execute a different version of PHP.
I do not have access to server config (httpd.conf, etc).
There are existing binaries on the server for the PHP version I want to use.
I've tried making a cgi wrapper for the PHP scripts, like how fastCGI wrappers are usually constructed:
* .htaccess has
AddHandler php-wrapper .php
Action php-wrapper /bin/wrapper.cgi
* wrapper.cgi has this code:
#!/usr/bin/sh
# without these headers, I get internal server error
echo "Content-type: text/html\n\n";
# The combination of variables is what I found would yield the
# required path to the incoming PHP script to be executed.
exec /path/to/php-cgi -q ${DOCUMENT_ROOT}${PATH_INFO} ${QUERY_STRING}
I've tried many different variations of the 'exec' line. Without 'exec', with just '-i' or '-v' as a parameter to php... But it either has a fatal error or gives me blank output.
The only thing that's yielded any expected results is '-h' parameter to PHP in the 'exec' line. I get the same help text that I would if I were using the command line.
I've tried recompiling cgiwrap using the new path/to/php, putting the binary in the public_html/bin directory, and changing the Action cgiwrap accordingly, but that resulted in a file not found error because the server concatenated the script path/filename onto the cgiwrap path.
Thanks for any ideas,
Kent
--
Kent Richards
510.292.7430
ke...@ke...
http://www.kentrichards.net
|