|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ActivePerl on win 98 with Apache server
Hello there,
On my local pc i got the apache server, and php 4 and Mysql running. This all works great. But now i installed active Perl and i want to execute perl form the apache server. I allready looked in the config files, but with my little knowledge i just can't get my cgi-bin to run .pl and .cgi files. Does anyone have an idea how and why etc etc ![]() Greetz from Holland Folkert |
|
#2
|
|||
|
|||
|
Error.log is a good place to start
Try calling " printenv.pl " from your browser.
I am quite sure this file is installed in the cgi-bin dir with apache as a test file. i.e. http://127.0.0.1/cgi-bin/printenv.pl Then look in the error.log file for apache if it does not work. Also is the first line of printenv.pl like : #!/usr/bin/perl yeilds "couldn't spawn child process:" in error.log as apache is trying to find perl in the wrong place on my win 98 it is : #!c:/perl/bin/perl Hope this helps . incase printenv.pl is not there: Code:
#!c:/perl/bin/perl
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/html\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"<br>\n";
}
__________________
Thanks Foot in Mouth ver 1.2.5 Onion |
|
#3
|
|||
|
|||
|
Thanx for your quick answer
![]() I did al the test thing with de sample file printenv.pl. What i didn't do was viewing the error log. That's wath i'm gonna do next. Thanx and i hope the answer is in the error log Otherwise I'llbe back.Folkert |
|
#4
|
|||
|
|||
|
The error.log says the same as the browser and that is file not found. It's there allready do. I think i need to look in the conf files ? perhaps from apache. Then maybe i can tell appache that perl is there ? In dos command perl -v it's there
![]() This is the first time for me with this, so the config file look al little difficult ![]() Folkert |
|
#5
|
|||
|
|||
|
warning's flag helps also
Add also the warning's switch
#!c:/perl/bin/perl -w Helps track down all sorts of fun errors. Look in the error.log to see the warning's. |
|
#6
|
|||
|
|||
|
Next look in httpd.conf
Open httpd.conf in a text editor.
Look for and correct to your situation: 1. BindAddress * [ leave if on dhcp ] 2. ServerName www.yourSite.com [ OR 127.0.0.1 ] 3. ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/" 4. DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs" Restart apache if changes are made to httpd.conf file. |
|
#7
|
|||
|
|||
|
You also have to help Apache recognize the .pl or .cgi extensions.
Open httpd.conf and make sure the following is in there: Code:
#
# AddHandler allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
#
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
The important part being the 'AddHandler' lines.
__________________
- dsb - ![]() Perl Guy |
|
#8
|
|||
|
|||
|
Woh you are great.
Okee footinmouth :) coming closer :) first the file was not found at all. Now the file gives a 500 error and a warning: A required .DLL file, PERLCRT.DLL, was not found I put this in de config: ScriptAlias /cgi-bin/ "C:/phpdev3/apache/cgi-bin/" #!c:/perl/bin (this is the map for perl.exe) Maybe it's this call ? ServerName 212.204.172.31 and tryed ServerName localhost Now i go view the error log again :) And i go check for the input from the last reply of dsb Thanx in advance [edit] Just found this in the error.log : [Thu Jul 12 18:44:25 2001] [error] [client 127.0.0.1] couldn't spawn child process: c:/phpdev3/apache/cgi-bin/printenv.pl [/edit] Folkert |
|
#9
|
|||
|
|||
|
I don't know perl and haven't read any of the replies... but I read somewhere that with windows, you have to name your files with .bat not .pl
This probably won't help.... |
|
#10
|
|||
|
|||
|
DJdrenaline,
I've got Win98 and Win2K running Apache with PerlCGI and PHP4 and that is not the case. Just an FYI. ![]() |
|
#11
|
|||
|
|||
|
That's what I thought, sorry I couldn't help
![]() |
|
#12
|
|||
|
|||
|
Still the same, only 500 errors and in the error still the message (in the topic )
Folkert |
|
#13
|
|||
|
|||
|
Out for a while
So you are getting a 500 error.
Try in a dos window, in the cgi-bin : perl -c printenv.pl which should just test compile the printenv.pl and display any obvious errors. Such as perl not found or a simple error in the perl file. I will put my thinking cap on soon so keep up the work. |
|
#14
|
|||
|
|||
|
Allrigth now
The printenv.pl runs and gives me back the vars from the server like server host etc ![]() It is working there. Now i reached (thanx a lot to you guys) a second level. How to instal flock() ? Folkert |
|
#15
|
|||
|
|||
|
Generally use ppm
Active State perl uses the perl package manager [ ppm ]
to install or upgrade packages with ease. You can get packages and compile on your machine also. See ActiveState web site for "Perl Modules" [ top right area]. See ActiveState also for ppm "Help" ppm example in DOS window: Code:
C:\Perl\bin>ppm help
Commands:
exit - leave the program.
help [command] - prints this screen, or help on 'command'.
install PACKAGES - installs specified PACKAGES.
quit - leave the program.
query [options] - query information about installed packages.
remove PACKAGES - removes the specified PACKAGES from the system.
search [options] - search information about available packages.
set [options] - set/display current options.
verify [options] - verifies current install is up to date.
version - displays PPM version number
C:\Perl\bin>ppm search flock
Packages available from http://ppm.ActiveState.com/cgibin/P...server.pl?urn:/
PPMServer:
File-FlockDir [1.02] override perl flock() for network or portability purposes
You may not need this package depending on your required results. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > ActivePerl on win 98 with Apache server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|