This may be a silly question, but have you checked the permission on the file you are attempting to execute. Also you
ownership definitions if you are running on Linux.
if needed).
Also your web server (Hopefully Apache) must be configured to execute CGI scripts.
Though these may be obvious questions to some, they are not implicitly obvious to all.