in reply to How to determine the program path from a set-uid program
I'm able to duplicate the problem easy enough, but I
can also get the name of the script through the web from Apache which
sets the variable $ENV{'SCRIPT_FILENAME'}. I can also get it
from the command line by looking at the value of the
environment variable "_". This was on a fairly old sparc,
so it may help, or may not.