View Full Version : Execute Perl CGI scripts on Windows XP?
Afrow UK
07-08-2004, 11:38 PM
I'm trying to get Internet Explorer to view Perl scripts on my hard drive. Rather than have to upload them to another webserver, I'd rather develop them (dynamic webpages) from home instead without the need for an internet connection to be active 24/7.
I've got the latest Apache Win32 server installed, and the latest ActivePerl, which both run fine, but I still cannot execute Perl scripts into a web browser which is my main aim.
It seems really stupid that there isn't a way to execute Perl into a web browser without having to run a server, but anyway...
I want to be able to run a CGI script from my D:\webdesign folder and all of its subdirectories into a browser as if I were viewing the website on another server.
There are tutorials on the web that I have found, but none of them have actually worked! Either they don't work on Apache 2, or I'm doing something wrong!
Thanks.
-Stu
dswimboy
07-09-2004, 04:22 AM
hmm...what fun.
well, first, i'd check to make sure ActivePerl works, from the command line. type something like "perl D:\webdesign\myscript.cgi". if it works, that's good.
then check to make sure your webserver is working correctly, just regular HTML pages.
if they are, then, we can assume the problem is somewhere in the interaction between them.
i am not familiar with Apache 2 on Win, i use IIS, which shipped with XP Pro.
this page may help: http://httpd.apache.org/docs-2.0/howto/cgi.html, and this: http://httpd.apache.org/docs-2.0/howto/ssi.html
i can't give you a lot of help, because you aren't being specific enough. are you trying to view a script directly, or post to a script with a form, or use SSI to view a script, or what? are you getting an error or nothing at all?
Afrow UK
07-09-2004, 12:37 PM
Well what I want to do is view Perl script in a web browser (the script output HTML), and of course send quiries and such like you would do on the net. I want to be able to do all that on the same PC that is running the webserver.
When I go into IE and enter the path to a script, it just executes the shell (which is the Perl command-line).
I have XP Pro, so should I use IIS?
-Stu
dswimboy
07-12-2004, 01:04 PM
When I go into IE and enter the path to a script, it just executes the shell
what path are you entering?
Afrow UK
07-12-2004, 01:23 PM
what path are you entering?
Well, e.g. D:\webdesign\hmd\default.pl
-Stu
Grant Palin
07-12-2004, 05:45 PM
D:\webdesign\hmd\default.pl
If you're doing that, then you're just reading the file locally.
You want to run it through the web server (if I understand correctly).
Have you made the change in the Apache configuration to execute Perl scripts? Have you set the document root to something other than the default (usually C:\Apache\htdocs)?
When you want to run a Perl script through Apache, you must have that script inside your document root. You also must make the appropriate changes to your Apache configuration to execute Perl scripts.
If you haven't made the changes to Apache, here (http://www.ricocheting.com/server/index.html) is an excellent tutorial for setting up Apache, Perl, PHP, and MySQLon Windows. This tutorial is the one I used to help me set up all the above-mentioned items on my Windows XP machine.
You're probably only interested in the Apache and CGI sections right now. Read the Apache section first for instruuctions for setting up your document root. Then the CGI section for running Perl through Apache.
After all that, try a URL like this:
http://localhost/webdesign/hmd/default.pl
The URL of course will differ depending on your ducument root structure (e.g. folders and files).
So try the tutorial, and see what happens.
Afrow UK
07-17-2004, 10:53 PM
That tutorial was excellent, and it works perfectly now.
Thanks!!
-Stu
Grant Palin
07-19-2004, 05:59 PM
Glad it's worked out for you. I was in your position only half a year ago, and I found that tutorial which got me all set up with a web server on my own computer. I was interested in all the options (Apache, Perl, PHP, MySQL), and got them all running (perhaps you might want to try PHP and MySQL too; they're all free!). And it's paid off!
Anyway, good work. Have fun! :thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.