Without knowing what web server you are using, or how it is being run, I can't say for sure what the problem is. That being said, my first guess would be that you are having a permissions issue. CGI scripts are generally run as a different user for security reasons, and only given access to a sub set of available resources. The user under which the script is being run when used as a CGI simply may not have read permission on the mount in question.
They say that time changes things, but you actually have to change them yourself.