Forum Moderators: coopster & phranque

Message Too Old, No Replies

Script execution error

Caused by path to script?

         

meesh26

1:02 pm on Feb 29, 2004 (gmt 0)

10+ Year Member


Hello! I am a newbie to the Perl/CGI world, and am trying to self-teach on my journey... However, I have run into a problem I hope you can help troubleshoot.

Per the script author, I have entered the command line in the .shtml file as follows:
<!--#exec cgi="/cgi-bin/test/test.cgi"-->

According to my hosting provider, CGI/Perl scripts must run through a specified directory:
http://cgibin.host.com/username/

I have tried several ways to enter the path to the CGI script, but always receive "An error has occurred while processing this directive".

The script works when run from the shell.

Any thoughts?

Thanks for your help,
Michelle

tombola

8:47 am on Mar 1, 2004 (gmt 0)

10+ Year Member



Welcome to Webmasterworld, meesh26!

There must be a space between " and -->

So, instead of

<!--#exec cgi="/cgi-bin/test/test.cgi"-->

it must be:
<!--#exec cgi="/cgi-bin/test/test.cgi" -->

meesh26

2:05 pm on Mar 1, 2004 (gmt 0)

10+ Year Member



Thanks for the message, tombola. I tried that, but received the same error message.

Any thoughts on what else I can try?

Also, when using

<!--#exec cgi="/cgi-bin/test/test.cgi" -->

should this path always start with /cgi-bin/?

If my service provider has advised that all CGI scripts must run through a specified directory, where do I point the script to that part of the path?

I have been doing a little reading on ScriptAlias. Is this something I might need to do?

tombola

5:25 pm on Mar 1, 2004 (gmt 0)

10+ Year Member



<!--#exec cgi="/cgi-bin/test/test.cgi" --> 

should this path always start with /cgi-bin/?

Only if that is the correct path to your 'test.cgi' script.

meesh26

8:31 pm on Mar 1, 2004 (gmt 0)

10+ Year Member



I think this is part of my problem.

According to my hosting provider, CGI scripts must run
through [cgibin.host.com...]

If I type in my address window
[cgibin.host.com...]
the script works.

I can't seem to find the correct path for the .shtml file.

I tried including the rest of this path in the exec command, and received the same error.

Instead of:
<!--#exec cgi="/cgi-bin/test/test.cgi" -->

I tried:
<!--#exec cgi="/cgibin.rcn.com/username/cgi-bin/test/test.cgi" -->

It seems no matter what combination I try, the path is just not correct.

Appreciate your help!

tombola

9:52 pm on Mar 1, 2004 (gmt 0)

10+ Year Member



Another line you can try:

<!--#exec cgi="/username/cgi-bin/test/test.cgi" --> 

If that doesn't work, just contact tech support of your hosting company and explain the problem ;-)

meesh26

10:27 pm on Mar 1, 2004 (gmt 0)

10+ Year Member



Thanks tombola. I will give it a try tonight.

I have already tried contacting support, and they advised they do not provide support for CGI scripts!

lexipixel

1:27 am on Mar 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Have you done the basic trouble shooting for Perl/CGI?

- have you been able to run any Perl/CGI scripts on the site? (ie- a simple hello world script in the CGI-BIN)

- If you have run other scripts on the site, Have you set the CHMOD settings for "test.cgi" correctly?

- If you are using FTP to upload the script, are you sure you used ASCII mode when you transfered the "test.cgi" file?

What host are you using? Do they have published FAQ files for CGI/Perl script issues?

flashfan

2:34 pm on Mar 2, 2004 (gmt 0)

10+ Year Member



Did you try <!-- #include virtual="/path/yourscript.pl" -->

flashfan

2:54 pm on Mar 2, 2004 (gmt 0)

10+ Year Member



Sorry, a syntax error (no space is allowed between -- and #include:

<!--#include virtual="/..." -->

meesh26

3:24 pm on Mar 2, 2004 (gmt 0)

10+ Year Member



This is the first script I am attempting to use on my page.

I have FTPd the script through as ASCII and CHMOD to 755.

I have tried the test.cgi script and the hello.pl script. Both produce the expected results from the web server. The problem occurs when I try to execute the script from the .shtml file.

When entering <!--#exec cgi="/cgi-bin/hello.pl" --> in the shtml file, I receive the same error.

I have read and re-read the FAQ provided by the service provider and have yet to figure out the problem.

According to the FAQ: 'All CGI programs and scripts must run through "http://cgibin.host.com". For instance, the action statement of your form tag would be: <form action="http://cgibin.host.com/username/cgi-bin/hello.pl" method="post">'.

No examples of the path for use of a 'exec cgi' command.

I have tried to include the full path in my exec command <!--#exec cgi="/cgibin.host.com/username/cgi-bin/hello.pl" --> and I get the same error.

If the script works from the web server, why doesn't the same path work under for executing the command?

lexipixel

4:14 pm on Mar 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have tried to include the full path in my exec command <!--#exec cgi="/cgibin.host.com/username/cgi-bin/hello.pl" --> and I get the same error.

If the script works from the web server, why doesn't the same path work under for executing the command?

It looks like you don't need the "/" before cgibin.host.com, ie-

<!--#exec cgi="cgibin.host.com/...

or maybe try-

<!--#exec cgi="http://cgibin.host.com/...

If neither works, and you want to send me a private message, I'll take a look at it on your server.