=head1 NAME Frequently asked questions for mod_perl on Win32 =head1 Description This document discusses some questions that arise often with mod_perl on Win32. =head1 Resolving Problems If you don't find a solution to your problem here, make sure to check the other troubleshooting documents according to the used mod_perl version as explained in the following sections. =head2 Problems with mod_perl 1.0 If you have troubles with mod_perl 1.0, please refer to the following documents: =over =item * L =item * L =item * L =back If the solution is still not found, see the L. =head2 Problems with mod_perl 2.0 =over =item * L =item * L =item * L =item * L. =back If the solution is still not found, see the L. =head1 Obtaining mod_perl =head2 Do I need Perl to use mod_perl? Yes, Perl is required. You can obtain a Win32 Perl binary from L. See also the all-in-one binary packages for both L and L which include Perl, Apache, and mod_perl. =head2 Are mod_perl ppm packages available? PPM packages for both L, for ActivePerl 6xx builds, and L, for ActivePerl 8xx builds, are available. =head2 Should I use mod_perl 1.0 or mod_perl 2.0? L, for use with Apache 1.0, is stable and well tested, while L, for use with Apache 2.0, is in a development stage. Normally, therefore, one would recommend mod_perl 2.0 only in a testing and development environment. However, on Win32 mod_perl 1.0 is subject to some serious L which are overcome with mod_perl 2.0; this, coupled with the improved performance of Apache 2.0 on Win32, may make mod_perl 2.0 a better choice. =head1 Installing mod_perl =head2 I get an "unable to load mod_perl.so" error when starting Apache. This can be due to a number of reasons. =over =item * Verify that mod_perl.so was compiled against the same Perl and Apache versions that you are using. If you are using Apache/2.x, note that modules compiled under Apache/2.0 will not work under Apache/2.2, and vice-versa. =item * Check that the directory containing C is in your I environment variable. =item * Try inserting a directive LoadFile "C:/Path/to/your/Perl/bin/perlxx.dll" before the LoadModule perl_module modules/mod_perl.so directive, where F is the Perl dll in your Perl I directory. =item * Try a reboot. =back =head2 How do I set the PATH environment variable? This differs according to the flavour of Win32 you are using. Search for I within the Windows Help utility under the Start menu for instructions. =head1 Configuring mod_perl =head2 How do I know scripts are running under mod_perl? You can test this by using a script which prints out the L; note that for mod_perl 2.0 a slightly L is required. =head2 I get an error about not being able to spawn a process for my CGI script. This means that the first line of your script (the I line), #!/Path/to/Your/Perl/bin/Perl.exe is not pointing to the location of your Perl binary. Shebang lines are common in a Unix environment, where they are used to indicate with which program a script is to be run by, but are not normally used as such on Win32, except in this context within Apache. =head2 My script gets returned as plain text. See the discussion of configuring L; for mod_perl 2.0, a L is required. =head2 I get a "Save-As" dialogue box when calling a script. If the extension of the file being called is C, or some other common extension, and if the problem happens with a browser on Windows, it may be that there is a file association set up within Windows for that extension. Try changing the extension of the file to something for which a file association is normally not present, such as C. If this doesn't help, see the discussion about L; note that for mod_perl 2.0, there is a L. =head2 My script displays a "Content-type" header in the browser. Check the setting of L; note that for mod_perl 2.0, there is a L. =head1 Using mod_perl =head2 One request must finish before another is processed. You are probably running into L of mod_perl 1.0; if this is a major problem, you should consider using L. =head2 My script just hangs. You should check the setting of L; for mod_perl 2.0, there is a L. If this setting is correct, and this occurs under mod_perl 2.0 and Perl-5.6.1, try upgrading to L. =head2 I get a "Can't find "Some::Module" in @INC ..." error If this is a custom module installed outside of the system Perl @INC directories, see I. If this is a mod_perl module, and you are using mod_perl 2, try using the I module, as described in L. =head2 When starting Apache, an error concerning a missing entry point in mod_perl.so appears. This might be due to an incompatibility between the installed mod_perl files in the Perl tree and the mod_perl.so library within the Apache (or Apache2) modules directory. If you're installing mod_perl via ppm, first try removing mod_perl (or mod_perl-dev, if you're using the development version): ppm> remove mod_perl Next, remove (or move to another location) the mod_perl.so library under the Apache (or Apache2) modules directory: C:\> del Apache2\modules\mod_perl.so (assuming F is your top-level Apache2 directory). You may have to stop Apache to be able to do this. Then install mod_perl via ppm: ppm> install mod_perl and ensure that the post-install script successfully fetches and installs F. =head2 I get a "Can't locate object method ..." error. First off, if this is due to running some script from the command line, this might be normal behaviour, as many Apache modules require one to be in the Apache environment to work. If this does occur from within Apache, and is a problem with mod_perl 2.0, it may be that the right module hasn't been loaded - see the discussion of L for a method to discover which module is needed. =head2 How do I run ASP scripts? For a mod_perl solution, check L for a discussion of the Apache::ASP module. =head2 How do I install additional Apache modules? If these aren't available via ppm from the repositories for L or L, you can build them using the L module. =head2 Why can't my scripts execute external programs with GUI frontends from within Apache/mod_perl? The issue is not an Apache/mod_perl issue per se. Any service that allows execution of external binaries that try to initialize and display GUI components will have problems under OSs like Windows 2K+, Unix, Linux and MacOS X. This would have worked in Win 98 because apps all run in the same user space (under the same user ID). Those resources happened to be, for the most part, linked to almost everything else running on the system. Hence when you ran a gui app from within Apache the system would display the gui part of it on the screen. The OS saw no difference between the web server running in the background and the user's desktop. The best way to deal with this is to see if the application you are trying to run has a /quiet switch or something that will keep it from trying to draw any GUI components/dialog boxes to the screen. If you wrote the application you are trying to execute then you should put a hook into it that will allow that option (obviously adding the code to bypass the gui code) and then execute it with the new option. The best way to execute programs under Perl's system call is to write a console application. If you would like to take output from that application then you should write to STDOUT all text you want the perl application to see as a return value from your C or `` (backticks) call. =head2 An error about being unable to load a file results when using a DBD database driver. Try putting the path to your database DLLs in your I environment variable. Also, make sure you are using the latest versions of I and your I driver. =head2 I get an error about being unable to load I. For mod_perl 1.0, make sure you have installed the I ppm package described for L; the I package available in the ActiveState repository will not work under mod_perl. A I package, suitable for use with mod_perl 2.0 / Apache 2.x, is available on L, with Win32 ppm packages: I, for Apache/2.0, and I, for Apache/2.2, available as described for L. =head2 My Apache2 installation did not come with the C utility. The utilities C, C, and C have not been fully ported yet to Win32 for Apache2. A development port is available in the F archive found under L; installation instructions are found in the accompanying F file. One can also install these utilties by running the F script under L. Note that this port does not offer yet the full functionality of the unix version - in particular, features enabling the utilities to be used within the Apache2 sources are missing. Nevertheless, they may be useful for building and installing 3rd-party C modules. =head2 Why is use of C on Win32 so slow? On Win32 Apache attempts to lock all writes to a file whenever it's opened for append (which is the case with logging functions), as Unix has this behavior built-in, while Win32 does not. Therefore C functions could be slower than Perl's print()/warn(). =head1 Maintainers Maintainer is the person(s) you should contact with updates, corrections and patches. =over =item * Randy Kobes Erandy@theoryx5.uwinnipeg.caE =back =head1 Authors =over =item * Randy Kobes Erandy@theoryx5.uwinnipeg.caE =back Only the major authors are listed above. For contributors see the Changes file. =cut