Change location of scripts

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Change location of scripts

Postby purge » 04. September 2009 18:10

Hello,

I am a newbie when it comes to scripting. Believe it or not I got introduced to perl because I wanted to run an Javascript example, but could not fully run the web file since it talked about cgi-bin script.

So I installed xampp for windows vista.

I went through the docs and examples and things were working fine, except when I ran the http://localhost/xampp/first.pl , I kept getting a 404 error.

I checked the httpd.conf to look on where I need to save the first.pl file, which shows (hello world).

I was saving the first.pl file in the c:\xampp\cgi-bin (where the folder also contains printenv.pl)

Well I eventually gave up and placed first.pl in the c:\xampp\htdocs\xampp and then ran the file via the web browser http://localhost/xampp/first.pl

The file worked and showed "hello world".

What I want to know is how I can get first.pl to run from c:\xampp\cgi-bin. I am sure scripts should be run from there. I feel it seems messy to place html and perl scripts in one place.

Thanks for reading.
purge
 
Posts: 3
Joined: 04. September 2009 17:59

Re: Change location of scripts

Postby Wiedmann » 04. September 2009 18:46

What I want to know is how I can get first.pl to run from c:\xampp\cgi-bin.

http://localhost/cgi-bin/first.pl
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Change location of scripts

Postby purge » 04. September 2009 21:13

Hello,

Thanks for prompt reply.

I moved the first.pl file back to xampp\cgi-bin

and then clicked on the link you gave me. This time I got this error shown below.

----------------------------------

Server error!

The server encountered an internal error and was unable to complete your request.

Error message:
couldn't create child process: 720003: first.pl

If you think this is a server error, please contact the webmaster.
Error 500
localhost

-------------------------------

Any ideas? If I place scripts including .cgi files back to xampp\htdocs\xampp then everything works fine. Tested an html form to return cgi code and no problems.

Its just scripts will not work outside that directory.

Thanks
purge
 
Posts: 3
Joined: 04. September 2009 17:59

Re: Change location of scripts

Postby Wiedmann » 04. September 2009 21:31

couldn't create child process: 720003: first.pl

I guess the shebang line is wrong.

BTW:
If I place scripts including .cgi files back to xampp\htdocs\xampp

Don't store your own files in "\xampp\htdocs\xampp".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Change location of scripts

Postby purge » 05. September 2009 00:05

Ok,

Thanks for your help. The shebang line was wrong hence it was #!/usr/bin/perl

and is now #!/xampp/perl/bin/perl.exe -w

The file first.pl can run from cgi-bin.

I have placed my form.html in the htdocs directory and that works fine as well.
purge
 
Posts: 3
Joined: 04. September 2009 17:59


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 109 guests