in reply to Call ksh script from CGI with environment variables

Most of the CGI's run with a small set of environment variables, are jailed (may not access that directory) or run as another user (nobody?) and can not access your .profile.

If you run it as yourself, your .profile is readable. So check: access to each and every directory in the path (must have rx) and access to the .profile (must have r). Usually the permisions are given to the group, including a chgrp is done to a group that your CGI user can access (add whoami >/tmp/who.log to your script_name.ksh)

so what you can do is run your ksh like this:

$out = `sh -x /mypath/script_name.ksh 2>&1 >> /tmp/debug.log`;

This will log all stdout and stderr to debug.log, where you can peruse the output for clues.