Forum Moderators: phranque

Message Too Old, No Replies

Problem while dealing with .js files and html files

         

kmanoj

12:57 pm on Jul 18, 2006 (gmt 0)

10+ Year Member



Hi,

We have an application written in perl, which makes use of javascript code for scripting. When I try to execute a perl program which uses a javascript code for checking the contents entered in a form I get the following error message in the apache webserver log:

Exec format error: exec of 'checkform.js'
failed
[Mon Jul 17 06:41:54 2006] [error] [client (IP address)] Premature end of script
headers: checkform.js

and also when I try to open an html file which is created by one of the perl scripts I get the following error message:

[Mon Jul 17 07:05:43 2006] [error] (13)Permission denied: exec of 'February_2004
_X11_defectdoc_sec.html' failed
[Mon Jul 17 07:05:43 2006] [error] [client (IP address)] Premature end of script
headers: February_2004_X11_defectdoc_sec.html, referer: [test17...]
nter_defects/viewdefectdocument.pl

Can anyone tell me what could be the root cause of the above problems? Thanks for your cooperation.

Regards,
Manoj

jdMorgan

4:01 pm on Jul 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



JavaScript is a client-side scripting language, that is, it executes in the browser, not on the server. Therefore, the PERL script should be sending the JavaScript as MIME-type text/JavaScript to the client, not attempting to execute it.

At first glance, it seems as though you may have put the JavaScript and HTML file into the executable cgi-bin directory, and by doing so, told the server to execute them. That won't work.

You may also have problems with missing MIME-type headers, or with other server response headers that your PERL script should be outputting, such as:


print ("Content-type: text/html\n");

Jim