Perl on XAMPP

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

Perl on XAMPP

Postby fakename » 07. April 2011 08:16

Hi,

I am a newbie to PERL and started it with XAMPP. I got to know that to run PERL CGi I need to have "lib" directory within "xampp/perl/" with "strict.pm" but there doesn't exist as such. I just have "bin" directory with "perl.exe" there. Please help me what should be done.
fakename
 
Posts: 8
Joined: 07. April 2011 08:10

Re: Perl on XAMPP

Postby Sharley » 07. April 2011 20:42

Which XAMPP version are you referring to?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Perl on XAMPP

Postby fakename » 08. April 2011 09:31

Its XAMPP for Windows Version 1.7.1
fakename
 
Posts: 8
Joined: 07. April 2011 08:10

Re: Perl on XAMPP

Postby Sharley » 08. April 2011 09:59

1.7.1 needs to have a perl add-on installed to get the full version.

Now download and install the perl add-on from here:
http://sourceforge.net/projects/xampp/f ... rl/5.10.0/

You need to decide which style of install either the installer or exe or the zip file of this version:
xampp-win32-perl-addon-5.10.0-2.2.11 pl2
Suitable for XAMPP 1.7.1
Read the readme-addon-perl.txt file contained in the addon download - all downloaded files can be opened with 7zip so you can read the readme file.

If you click on the little black circle with i in it then you can read the release notes for each version and then you can decide which to use.

Let us know how you get on.


BTW XAMPP 1.7.2 onwards has full perl included in the installation - 1.7.1 was the last version that needed an add-on.


Best wishes.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Perl on XAMPP

Postby fakename » 11. April 2011 10:52

Hi,
I have installed xampp 1.7.2. But after installation the php files in cgi-bin folder have stopped working giving the following error "Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. " :cry:
fakename
 
Posts: 8
Joined: 07. April 2011 08:10

Re: Perl on XAMPP

Postby Sharley » 11. April 2011 10:55

Read the \xampp\apache\logs\error.log file for clues about your server error.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Perl on XAMPP

Postby fakename » 11. April 2011 10:58

It says
"[Mon Apr 11 15:07:08 2011] [error] [client 127.0.0.1] (9)Bad file descriptor: don't know how to spawn child process: H:/xampp/cgi-bin/midi/midi.php
[Mon Apr 11 15:10:26 2011] [error] [client 127.0.0.1] H:/xampp/cgi-bin/index.php is not executable; ensure interpreted scripts have "#!" first line
[Mon Apr 11 15:10:26 2011] [error] [client 127.0.0.1] (9)Bad file descriptor: don't know how to spawn child process: H:/xampp/cgi-bin/index.php"
fakename
 
Posts: 8
Joined: 07. April 2011 08:10

Re: Perl on XAMPP

Postby Sharley » 11. April 2011 11:25

You need to add a shebang line to the top of every file that contains perl script that you want to be executed in the cgi-bin like so:
Code: Select all
#!"H:\xampp\perl\bin\perl.exe"
It has to be the very first line right at the top of the page before anything else.
Save the files and then try again to execute your scripts.

This line in your error message was the clue
Code: Select all
[Mon Apr 11 15:10:26 2011] [error] [client 127.0.0.1] H:/xampp/cgi-bin/index.php is not executable; ensure interpreted scripts have "#!" first line
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Perl on XAMPP

Postby fakename » 11. April 2011 11:41

Thanks for your reply. I did that but got the following error
"The server encountered an internal error and was unable to complete your request.

Error message:
Premature end of script headers: index.php "

My script says
"
#!"H:\xampp\perl\bin\perl.exe"
<?php
?>
<form method="post" action="test.pl">
<textarea name="mytextarea">textarea content</textarea>
<input type="submit" name="submit" value="submit" />
</form>
"
fakename
 
Posts: 8
Joined: 07. April 2011 08:10

Re: Perl on XAMPP

Postby Sharley » 11. April 2011 11:48

Code: Select all
"
#!"H:\xampp\perl\bin\perl.exe"
<?php
?>
<form method="post" action="test.pl">
<textarea name="mytextarea">textarea content</textarea>
<input type="submit" name="submit" value="submit" />
</form>
"
I said to put the shebang right at the top of your page and you put it on the second line.

What are these 2 " " doing floating in space.

You index.php is either not complete or you need to do some more reading - there is no php code included and have you put the shebang line in your test.pl script?
Code: Select all
#!"H:\xampp\perl\bin\perl.exe"
<?php
?>
<form method="post" action="test.pl">
<textarea name="mytextarea">textarea content</textarea>
<input type="submit" name="submit" value="submit" />
</form>
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Perl on XAMPP

Postby fakename » 11. April 2011 11:50

I added this
#!"H:\xampp\perl\bin\perl.exe"
<?php
?>
<form method="post" action="test.pl">
<textarea name="mytextarea">textarea content</textarea>
<input type="submit" name="submit" value="submit" />
</form>

those were the double quotes
fakename
 
Posts: 8
Joined: 07. April 2011 08:10

Re: Perl on XAMPP

Postby Sharley » 11. April 2011 11:56

Use the forum Code tags from the menu when you write code in a post, that's what the Code tags are for.

Try and remove the php tag lines as I can't see you need them as there is no php code in between.

Then you can rename that file index.html
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Perl on XAMPP

Postby fakename » 11. April 2011 11:59

Hi
I removed the tags and renamed the file. When I try to access it, it gives the error
Server error!

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

Error message:
Premature end of script headers: index.html

If you think this is a server error, please contact the webmaster.
Error 500
fakename
 
Posts: 8
Joined: 07. April 2011 08:10

Re: Perl on XAMPP

Postby Sharley » 11. April 2011 12:04

I did say that server errors should be read from the apache error log file not the browser.

Remove the shebang line as you don't have any perl code either to execute.

You really do need to do some reading and learning as we are here to help with any issues you have with XAMPP and it's components not to tutor code issues.

Sorry I can't be of any more help.

Good luck.
Last edited by Sharley on 11. April 2011 12:11, edited 1 time in total.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Perl on XAMPP

Postby fakename » 11. April 2011 12:11

Thanks for your reply but I never added that line and did that when asked by the forum members coz I myself being an experienced php programnmer know that we don't need to add the lines until and unless needed and and after removing the line I am back to the same problem.
Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

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

I already played with all this stuff which you told but did again on the faith that forum members are right coz they guide.

Thanks.
fakename
 
Posts: 8
Joined: 07. April 2011 08:10

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 146 guests