DirectoryIndex not allowed here (localhost)

software development


I figured it was time to stop tinkering with my sites “live, without a net” and set up a local development environment. I successfully installed phpdev so I now have Apache, php, mysql, phpMyAdmin running on my XP home box. I downloaded ActiveState Perl and got it running. I was shocked and amazed to see my cgi scripts running locally. (I’m a newbie and easily amused :slight_smile:

I’m stumped though on one script that, on DH, I use an .htaccess file to set the DirectoryIndex to ‘scriptname.cgi?some_parameter=setting’. It’s a calendar script and it automatically pulls the month’s events, rather than the default day’s display. Works a treat on DH but the Apache error log shows:

c:/phpdev/www/ DirectoryIndex not allowed here

Not sure where to look or what file to edit to replicate what seems to work on DH.

Thoughts, tips, pointers welcome. Speak slowly and use small words :slight_smile:


Have you set this in the http.conf file?

AllowOverride directive

It’s set in sections of the server config file (http.conf) to prohibit certain directives from being used in .htaccess files.


Cool, thanks! Progress…

Can’t locate in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at c:\phpdev\www\ACTCA~1.US\calendar\ line 48.
BEGIN failed–compilation aborted at c:\phpdev\www\ACTCA~1.US\calendar\ line 48.

This is actually progress. I don’t know what it means but will spend some time figuring it out. It’s a much more interesting failure than ‘not allowed’ :slight_smile: Also, I’m thinking it has to do with incomplete setting up of MySql dbs.

Thank you for pointing me to the httpd.conf section.


Actually its looking for the Perl DBI module and not able to find it. IF DBI is not already installed, you will have to install it. You will also need to install DBD::mysql to use MySQL in Perl. Then you will be able to connect to MySQL and see if you configured MySQL correctly.

I am using ActivateState Perl 5.6.1 on Windows and this is how you install these modules:

  1. Open Command Prompt window and enter “cd C:\Perl\bin”
  2. Enter “PPM” to execute the ‘PPM interactivate shell’ for installing modules, you will then see:

PPM interactive shell (2.1.6) - type 'help' for available commands. PPM>3. Enter “install DBI” to install the DBI module. This will fetch it from ActivateState’s servers first.
4. When that is done, enter “install DBD-mysql” to install the MySQL database driver, again fetching it from ActivateState first.
5. Enter “quit” to exit the PPM shell.
6. Note that the documentation for these modules should have been added to your local HTML documentation at C:\Perl\html\index.html

Here’s a tip - if you install Perl to C:\usr\local instead, you can run scripts on Windows without having to modify the shebang before uploading them to DreamHost -
#!/usr/local/bin/perl is translated to C:\usr\local\bin\perl.exe in Windows by Apache.


That was worth the price of admission right there. Thank you. I was making a mental note to comment or otherwise compensate for the shebang path. Your suggestion is much better. I appreciate the PPM steps as well. Most things get easier with some experience; these first baby steps are the hardest.

Best regards.


Hm. How do I specify \usr\local etc? The AS installer never asks for a path.


In addition to being a dope, I’m also screen-blind: you most definitely CAN specify the install directory. Doh! Also found in the docs: if installed from the command line rather than the installer you can specify the TARGETDIR. Neato. I just deinstalled and reinstalled using the very slick install manager.


Very interesting thread. It’s so weird to see people talking about Perl, when all of their “slashes” are backwards.


  • Jeff @ DreamHost
  • DH Discussion Forum Admin