how to run perl script

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

how to run perl script

Postby spanish26 » 01. February 2009 12:21

Hello,

I just installed XAMPP in my computer and i have a perl script i want to run using the XAMPP.however i saved the script in cgi-bin folder and then i used the url http://localhost\xampp/cgi-bin/script.cgi to view the program in html, when i run the program in browser i get error 404, the reuested URL was not found on server.

Please any suggestions

Thanks
Last edited by spanish26 on 01. February 2009 12:50, edited 1 time in total.
spanish26
 
Posts: 21
Joined: 01. February 2009 12:16

Re: how to run perl script

Postby Izzy » 01. February 2009 12:33

XAMPP does not have a perl editor included.

XAMPP comes with MiniPerl included.

If you want a more complete perl then install the XAMPP perl addon.

To run a script put it in the xampp\htdocs folder or the xampp\cgi-bin and run it like this:
http://localhost/myscript.cgi
or if in the cgi-bin
http://localhost/cgi-bin/mycgiscript.cgi

There are some test scripts here:
http://localhost/cgi-bin/perltest.cgi
http://localhost/cgi-bin/cgi.cgi

Make sure the first line of your script, the shebang, looks like this if you installed XAMPP to the default location:
#!"C:\xampp\perl\bin\perl.exe"

You can edit a cgi script in Notepad or you in favorite text or script editor.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: how to run perl script

Postby Izzy » 01. February 2009 12:55

spanish26 wrote:http://localhost\xampp/cgi-bin/script.cgi to view the program in html, when i run the program in browser i get error 404

Did you read my post before editing your first post which is completely different from your original post and completely wrong?

Please read my post or I am wasting my time.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: how to run perl script

Postby spanish26 » 01. February 2009 13:11

Please am sorry for the mix -up,no you are not wasting your time, i was able to fix the first problem, that why didnt know you replied, sorry!!!, i did as you said, my script name is " script.cgi" and i saved it in cgi-bin folder, then i used the url http://localhost/cgi-bin/script.cgi and when i run the program i recieve the error : the server encountered an internal error and was unable to complete the request, either the server is overloaded or error with cgi script.
Error 500, that is what appear now.

Thank you
spanish26
 
Posts: 21
Joined: 01. February 2009 12:16

Re: how to run perl script

Postby Izzy » 01. February 2009 13:15

Server 500 errors are explained in the xampp\apache\logs\error.log file.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: how to run perl script

Postby spanish26 » 01. February 2009 19:50

I tried ans still getting the error 500, i deactivated the MYSQL in the control panel , can this affect the server from not displaying the web page.
spanish26
 
Posts: 21
Joined: 01. February 2009 12:16

Re: how to run perl script

Postby Izzy » 01. February 2009 23:02

spanish26 wrote:I tried ans still getting the error 500, i deactivated the MYSQL in the control panel , can this affect the server from not displaying the web page.
I don't know because I can't see your error log or anything else you are doing from here.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: how to run perl script

Postby spanish26 » 02. February 2009 03:49

The error log shows File does not exist:C/Program Files/xampp/htdocs/xampp/htdocs, this is what i find on the error log, but wwhen i check the folder the file is there and saved in the htdocs folder.
spanish26
 
Posts: 21
Joined: 01. February 2009 12:16

Re: how to run perl script

Postby Izzy » 02. February 2009 04:00

spanish26 wrote:The error log shows File does not exist:C/Program Files/xampp/htdocs/xampp/htdocs, this is what i find on the error log, but wwhen i check the folder the file is there and saved in the htdocs folder.
Then the error message is quite clear the file in the path that is specified does not exist - correct what ever is causing it and you should be right.
C/Program Files/xampp/htdocs/xampp/htdocs

Unlike some humans, error log files do not tell fairy tales.

Looks to me like you should uninstall XAMPP and after stopping all the XAMPP components and uninstalling any service, delete the xampp folder.

Then install again and this time follow the installation instructions on the XAMPP home page and install to the C:\ drive not to C:\Program Files or any other folder with a space in the name especially if you are running on Vista, which BTW you have not mentioned yet.

Your path will then be C:\xampp\htdocs\
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: how to run perl script

Postby spanish26 » 02. February 2009 05:10

Ok, but please before i uninstall the folders, i just ran the program again and displayed a new message : the server encountered an internal error and was unable to complete your request.
Error message: couldnt create child process: 720021: script cgi
spanish26
 
Posts: 21
Joined: 01. February 2009 12:16

Re: how to run perl script

Postby Izzy » 02. February 2009 06:59

Is that the full error message from the error.log file?
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: how to run perl script

Postby spanish26 » 02. February 2009 07:05

well from yesterday upto this moment there are many errors in the log, but this is the most current error now :(os 3)The system cannot find the part specified, : couldnt spawn child process: C:/Program Files/xampp/htdocs/script.cgi, although there are other errors that have a similar syntax, i can post the error log if it is okay by you.
spanish26
 
Posts: 21
Joined: 01. February 2009 12:16

Re: how to run perl script

Postby Izzy » 02. February 2009 07:43

spanish26 wrote:well from yesterday upto this moment there are many errors in the log, but this is the most current error now :(os 3)The system cannot find the part specified, : couldnt spawn child process: C:/Program Files/xampp/htdocs/script.cgi, although there are other errors that have a similar syntax, i can post the error log if it is okay by you.
Stop Apache and open your error.log file in a text editor and delete all the entries, then save the file and restart Apache.

Now run your script and if it errors then copy and paste the contents of the error.log file, now there will only be the latest issues to copy and paste here.

BTW what is this script that will not work and have you installed the Perl addon as the MiniPerl included in XAMPP may not work for your script - but still a reinstall is still recommended.

What OS?
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: how to run perl script

Postby spanish26 » 02. February 2009 08:09

This is the error message:
[Mon Feb 02 14:55:34 2009] [notice] Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5 configured -- resuming normal operations
[Mon Feb 02 14:55:34 2009] [notice] Server built: Jan 18 2008 00:37:19
[Mon Feb 02 14:55:34 2009] [notice] Parent: Created child process 2232
[Mon Feb 02 14:55:35 2009] [notice] Child 2232: Child process is running
[Mon Feb 02 14:55:35 2009] [notice] Child 2232: Acquired the start mutex.
[Mon Feb 02 14:55:35 2009] [notice] Child 2232: Starting 250 worker threads.
[Mon Feb 02 14:55:35 2009] [notice] Child 2232: Starting thread to listen on port 443.
[Mon Feb 02 14:55:35 2009] [notice] Child 2232: Starting thread to listen on port 80.
[Mon Feb 02 14:57:35 2009] [error] [client 127.0.0.1] File does not exist: C:/Program Files/xampp/htdocs/xampp/cgi-bin
[Mon Feb 02 14:59:40 2009] [error] [client 127.0.0.1] File does not exist: C:/Program Files/xampp/htdocs/xampp/cgi-bin

And this is my shebang : #!"C:\Program Files\xampp\perl\bin\perl.exe" and i installed the xampp on my desktop with the path : "C:\Program Files\xampp\xampp-control.exe" , although i tried alternating the paths it didnt make any difference when running

It is a perl script. i have not installed the perl addon
spanish26
 
Posts: 21
Joined: 01. February 2009 12:16

Re: how to run perl script

Postby Izzy » 02. February 2009 08:17

spanish26 wrote:[Mon Feb 02 14:57:35 2009] [error] [client 127.0.0.1] File does not exist: C:/Program Files/xampp/htdocs/xampp/cgi-bin
[Mon Feb 02 14:59:40 2009] [error] [client 127.0.0.1] File does not exist: C:/Program Files/xampp/htdocs/xampp/cgi-bin
What exactly do you type in the address bar of your browser to try and load the perl script?

spanish26 wrote:It is a perl script. i have not installed the perl addon
You are not getting the server 500 error (script error) but a 404 file not found error at this stage.

spanish26 wrote:i installed the xampp on my desktop with the path : "C:\Program Files\xampp\xampp-control.exe"
This is only a shortcut on your desktop to the XAMPP Control Panel (XCP), correct? Not the location you installed the all XAMPP files to C:\Program Files\xampp is where XAMPP is installed on your hard drive, Correct?

I asked what OS are you using?
Last edited by Izzy on 02. February 2009 08:24, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 54 guests

cron