PDA

View Full Version : cgi scripts



espice
October 11th, 2007, 10:35
HOW to run cgi scripts through cpanel.
I uploaded cgi script in cgi-bin folder but from browser i try to opened it but it is giving error.
I tried other cgi scripts but same so how to run them.

krakjoe
October 11th, 2007, 11:11
you need to chmod the file to 755 so the servers CGI ( perl ) can execute it ...

espice
October 11th, 2007, 12:01
i did 755 and also 777 but same error . here is this

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@i.espice.cn and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

also in cpanel the path to perl is /usr/bin/perl so in script i have kept t is #!/usr/bin/perl -s
or i have to change it as i m trying this in subdomain .

plz tell me from starting to end so i will do it again as you say . plz tell me as done in cpanel

krakjoe
October 11th, 2007, 12:09
assuming you're not the root user, all you have to do is upload the file and change its permissions to be executable a+x/0755/755

if you're root you probably need to change the owner permissions of the script ...

espice
October 11th, 2007, 12:14
i did it with ftp ,or i have to do with some other way cgi-bi 0755 and file which i uploaded in it also 755. so what wrong i m doing . i am opening that file by browser as http//i.espice.cn/cgi-bin/filenamexxxxxx.cgi or i m opening it wrong way.

krakjoe
October 11th, 2007, 12:22
no, you seem to be doing everything correctly, you might think about contacting your host.

DanTheMan
October 11th, 2007, 22:17
try this: upload it in a zip file. then uncompress it on the server then move it to the cgi bin and then try it.


i had trouble with the cgi proxy but doing it this way made it work. i dunno why...