954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to run a cgi script on xampp?

Hi there,

yesterday I tried a very basic cgi program, which comes with xampp 1.7.1 in cgi-bin directory.
but my browser said:
"You don't have permission to access the requested object. It is either read-protected or not readable by the server."
The perl code is :

#!"C:\xampp\perl\bin\perl.exe"

print "Content-type: text/html\n\n";
print '<html>';
print '<head>';
print '<meta name="author" content="Kay Vogelgesang">';
print '<link href="/xampp/xampp.css" rel="stylesheet" type="text/css">';
print '</head>';
print "<body>&nbsp;<p><h1>GCI with MiniPerl</h1>";
print  "CGI with MiniPerl is ready ...</body></html>";


The file name is "perltest.cgi" and I executed it by typing
"http://localhost/C:/xampp/cgi-bin/perltest.cgi" in my browser.

please help!

regards

prashantkaushal
Newbie Poster
2 posts since May 2011
Reputation Points: 18
Solved Threads: 0
 

I don't know but you could start by finding your httpd.conf file and having a look at this post in case the solution to that person's problem throws light on yours.

d5e5
Practically a Posting Shark
810 posts since Sep 2009
Reputation Points: 159
Solved Threads: 159
 

so here are the steps:

1. Download " XAMPP" from http://www.apachefriends.org/en/xampp-windows.html ( Do not download XAMPP Add-Ons)

2. After installation look for a folder naming "XAMPP" in C:

3. Create a folder (say "perl" in which u will place all ur .cgi files) in htdocs of it.

4. Now create ur ".cgi" file and give the path to perl (like #!"C:\xampp\perl\bin\perl.exe" in shebang line of ur program)

5. Save ur file with ".cgi" extension in previously created "perl" folder.

6. Now open ur web browser.

7. Type "localhost/"

8. If Apache is running on ur system then it shows "It's working!". If it's not then go to the shortcut on ur desktop and just double click on xampp icon. This will start ur all services associated with xampp.

9. If ur apache is in running state then again open browser and type "localhost/perl/filename.cgi", press enter.

10. DANCE AROUND THE FLOOR.... WOOOHOOO!!! Finally u somehow managed to run a cgi script. :D

prashantkaushal
Newbie Poster
2 posts since May 2011
Reputation Points: 18
Solved Threads: 0
 

how will it work for fedora? Plz help

shrpra
Newbie Poster
1 post since May 2012
Reputation Points: 0
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: