I'm not too hip on scripts being in the same directory as html but you are using the correct directives to do the job so I'm not sure what the problem is. In most cases cgi scripts are set to 755 but there are some configurations where apache thinks these are executables. Try setting one of the scripts to 644 to turn of the x bit and see if that changes things. If all this fails, you will need to address the original error. The error message you are getting is saying that for some reason apache could not read the shebang (first line in the script). This could be due to many reasons such as a corrupt file. This can happen when you transfer a text file in binary mode or compressing a file on Windows and unzipping it on linux. The problem here is that there are end of line characters and carriage returns that don't belong. When apache tells the browser it can't serve the page, the browser doesn't care what the problem is, it just tells you that the server is misconfigured.