a cgi script runs as wwwrun or www or whatever. Which is why it can't get at a "user" .profile.
From my understanding the .profile was a config file that isn't loaded until you launch a terminal session and unloaded on close. Usually the profile.local is the global profile.
Perhaps the better question is what you are trying to glean from the file that might be gleaned thur another way.