Gossamer Forum
Home : General : Perl Programming :

activeperl on xp...again

Quote Reply
activeperl on xp...again
 
Some months ago, or something, I posted some questions about how to install perl on xp. I didn't get apache up and running, but now I want to get all right because I have this script I need tested with perl and mySQL. Yes, I want to install mySQL too.

I uninstalled the whole package I had from before and downloaded activeperl, mySQL v. 4.0.14. I think.. I also downloaded apache from apache.org.

I installed everything. Of some reason perl installed itself on the D: drive, not sure how that happened, but it shouldn't be a problem. Should it?

Apache and mySQL were also placed on my D drive.
Tested http://localhost/ and http://213.239.127.118/ (my ip address..).

Got this nice congratulation message. Everything have worked fine...blablabla. And that this page must be replaced with real content.

I know I only can run .pl file and thats just fine. ( Have read:
http://www.gossamer-threads.com/...%20perl%20xp;#209011 )


I have this problem that if I try to run a perl script, say this test script: print "Hello cruel world!";
or something like that, I just get the message Cannot find page.

Where on my computer do I have to place the testing files? D:\perl\bin\file.pl?? I tried that, but it didn't work. Neither in the dir. below.

And how bout the she bang line:
#!/usr/bin/perl ? Can this be used.

Apache is running smoothly and I think I got the most up working. Anyone willing to help?

Thanks for all response. Sorry if I gave you little information.

- perlman
Quote Reply
Re: [perlman] activeperl on xp...again In reply to
Hello Perlman,

The default httpd.conf file uses as per line 520 :

ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"

So you would put pl or cgi files into that directory and access them

from the browser as http://127.0.0.1/cgi-bin/HelloWorld.pl

Lots of documentation is found in C:\Program Files\Apache Group\Apache2\manual

On windows I use : #!/perl/bin/perl where perl is installed on C: drive



So :

#!/perl/bin/perl

print "Content-Type: text/html \n\n";

print "Hello World...\n";

Is a really small test file of three lines

you might need to use #!D:/perl/bin/perl

You should find in the cgi-bin a testing file called printenv.pl , http://127.0.0.1/cgi-bin/printenv.pl

The first line in there may be correct , mine says #!c:/Perl/bin/Perl.exe


Thanks cornball
Quote Reply
Re: [perlman] activeperl on xp...again In reply to
If you want the PL CGI files in your website folder, you can change the paths in the ScriptAlias. And for Windows servers, it isn't always necessary to put the shebang line in the script. There is also a way to set-up the Perl path alias, so that it can be the same between your development Windows server and your production server, but I've not been able to get this to work in my local dev environment.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [cornball] activeperl on xp...again In reply to
Thank you very much for your reply! It really helped!
Everything is working and looking good.

Tested some small scripts and it was really cool, but now I have one more question:

Can I run larger script like a message board? How should the settings be? Like say the path to different directories. Can I set up something huge and complicated like that, or would it be a lot of work?

And what about databases..I have mySQL installed and would loved to use it on a script I'm writing!

Can you help me with this cornball? You seemed to know a great deal about this..


And one more question:
I have a strange problem. Last time I installed Apache something really weird happened. On my browers homepage, all the banner ads disappeared. You would think this was a good thing, but they were replaced by the congratulation page Apache displays on localhost. It is quite annoying. When I uninstalled apache the message disappeared and got replaced by this nice 404 Cannot Find page message. I've had this problem for about a whole year.
Look at the picture I've uploaded. It's all in norwegian, but you might get the picture? get the picture. haha. you get it? back to the point:

How in God's name can this have happened?

It's not something important, but everyone in my family keep asking what Apache is and telling me to get rid of it. Unsure I don't know how.

I appreciate all help!

- perlman
Quote Reply
Re: [perlman] activeperl on xp...again In reply to
no one who wants to help me? Just need som advises and such. Smile

Please reply if you can. Thank you.

- perlman
Quote Reply
Re: [perlman] activeperl on xp...again In reply to
Yes, you can execute "larger scripts", but what you will have to do is use your local physical paths in the scripts (like D:/webroot/website/somepath) and you have to have the proper Perl modules, including DBI and others, installed to run more complex scripts.

What you should consider doing is having multiple configuration files (one for your production remote environ and one for your dev environ), basically using the CGI variable for SERVER_NAME to differentiate which config file to require or use.

In terms of the 404 NOT FOUND, you could set-up custom error messages in your .htaccess file for each website you've configured using ErrorDocument directive.
========================================
Buh Bye!

Cheers,
Me