I've successfully installed Drupal 5.1 on one of my servers running Mac OSX 10.4. I got the databases set up properly using PHPMyAdmin.

Apache 2.0.52
MySQL 4.0.17
PHP 4.3.9

Settings in settings.php:

$base_url = 'http://localhost/pontiacgto';

If I simply point my web browser to 'http://localhost/pontiacgto/', I get a directory listing and it doesn't automatically load the index.php file. If I then load the index.php file and then try to click on a link in that file so that the URL changes to 'http://pegasus.local/pontiacgto/?q=admin', I then get a directory listing again. It doesn't appear to be loading the correct module that is needed. It does this from any link I try to click on in the page, not just the Administrative link.

The interesting thing is that if I point my browser to another directory on that server that has an installation of Gallery2 in it (i.e., 'http://localhost/Gallery2/'), that loads automatically the index.php file just fine and all the links work.

I did check out the Troubleshooting FAQ, but didn't find anything relevant. In addition, I tried a search on the forums, but may not have used the correct terms because again, I didn't find anything relevant.

Frankly, I'm thinking that this is probably a setting problem with Apache or PHP, but I don't understand why it would work fine in Gallery2, but not in Drupal and I'm confused about where to look to track down the problem. Any pointers would be greatly appreciated.

Greg

Comments

cog.rusty’s picture

Drupal's .htaccess file contains the line

DirectoryIndex index.php

which makes Apache look for an index.php file and run it.

- Either the .htaccess file is missing or modified
- Or it is ignored because your Apache httpd.ini file has an AllowOverride None directive which must be changed to AllowOverride All. That should be inside a <Directory /[blah]/htdocs> section.

pontiacgto’s picture

Thanks. That was it. There was no .htaccess file in the Drupal directory. Once I created it and included the above line, everything seems to work fine now.

I appreciate your help.

Greg

cog.rusty’s picture

Consider uploading the original one from a drupal package because it does other things too. for example it contains some lines which allow "Clean URLs" to work.

ravisagar’s picture

My Document root in httpd.conf file is set to the directory where drupal files exist. And I have .htaccess file also. But still all the links takes me to the Document root.

Help!!

cog.rusty’s picture

That sounds right if Drupal's installation directory is your document root.

Can you explain the problem better?

You have installed drupal in an htdocs/drupal directory?
The domain http://domain points to htdocs/drupal?

You go to http://domain and Drupal comes up?
And you see the links pointing to what exactly?

majid_b’s picture

I have installed fresh Dupal 5.x version on localhost but when I try to go the installation directory, it doesn't pick up the index.php file automatically instead it goes to the directory listing "Index of /drupal-5.12", when I click on index.php page it takes me to correct page but now, when I click on any of the links it takes me back to the directory listing "Index of /drupal-5.12" and I have to add index.php before the "?" mark in order to make it work.

There was no httpd.ini file present in the htdocs folder, so, I created it and added the line "AllowOverride All" but it didn't solve the problem.

Also after creating that file when I try to access index.php it tells me "page not found"

Please Help!

dman’s picture

You do not place a httpd.ini file in your web folder (at least not in any OS I know - I guess it's possible)
You are posting in a MacOSX thread, so http://drupal.org/node/232460 may be where you need to look. or The mac install instructions

The Apache (httpd) configuration file can be found in various places in various distributions, but commonly in
/etc/apache2 /etc/apache or for old systems: /etc/httpd.
The config file is apache2.conf or httpd.conf . I've not seen it called httpd.ini before, but I guess your MAMP may do that?

The point is, you need to have AllowOverride All in the actual relevant config file, and to restart your webserver.
It looks like you do not.

The key failure right now is you have not got DirectoryIndex index.php set anywhere. Well... anywhere that works.
All this comes down to Apache configs and PHP installation. Read up a bit on that if that's your problem. This is normal "make PHP work" steps that should coume first. Only once that's sorted out will Drupal be able to work.

I'll admit, in a short search I could not find the specific docs here on d.o. that contain the OS-specific Apache config instuctions you need. Looks like something could be added. If you can describe the version of OSX you have and the Apache and PHP packages you chose, perhaps you can write up the bit that's missing.

.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |

cog.rusty’s picture

A shorter version of dan's answer:
- You need a DirectoryIndex index.php directive which applies to your Drupal directory.
- Drupal's .htaccess file (if you have it) already contains that directive, but to allow .htaccess files to work, Apache's httpd.conf must *not* contain an AllowOverride None.

Notice that httpd.cong may contain more that one AllowOverwrite lines, so:
- Make sure to replace the ones which apply to your drupal directory (or all of them).
- You must restart Apache for this to take effect.

majid_b’s picture

I am sorry, yea I found out that the correct file is httpd.conf <<< it is a text file.

But even after changing AllowingOverride to All (which is listed few times in the file) it is not picking up the index.php file. I am using windows XP.