Hi all,
I've downloaded Drupal and have got to the welcome page. When I try to use the link to 'create the first account', it goes to this address: http://localhost/drupal-5.2/?q=user/register and lists the directories and files. I created an account via the Drupal homepage, but I can't login with that username to the welcome page on my localhost server. Does anyone know what's going on?

Comments

cog.rusty’s picture

If the files and directories which you see there are Drupal's files and directories, then the problem is probably the following:

Drupal's .htaccess file, which should be in your drupal installation directory, contains two lines (among other things)

Options -Indexes
for not showing directory file listings, and even more important:

DirectoryIndex index.php
for running drupal when you browse to its directory.

- Either the .htaccess file is missing from the drupal-5.2 directory,
- Or your Apache setup does allow it to work, in which case you have to edit Apache's httpd.conf and change AllowOverride None to AllowOverride All

monkeyinquisition’s picture

Those two lines are there and I've changed httpd.conf but it still goes to the files and directories of the drupal folder. I can see the index.php page ok but it does display this warning :user warning: Unknown column 'uid' in 'field list' query: SELECT uid FROM users WHERE uid = 1 in C:\Apache\htdocs\drupal-5.2\includes\database.mysql.inc on line 172. Any ideas?

cog.rusty’s picture

Your .htaccess does not seem to work... What was the <Directory> section where you put AllowOverride All? Check if there is another AllowOverwrite None further down, in a <Directory "C:/Apache/htdocs"> section. If so, that is the one which needed changing.

The error message in the query is also strange. It finds a users table but it does not find an uid field in it. Did you have a users table from another application there? Did you specify any table name prefix in Drupal's setup? (like 'dru_users'). This needs detective work to figure out. Can you take a look in your database with phpmyadmin to see if there are about 40 drupal tables there? What fields does the users table contain?

monkeyinquisition’s picture

The directory tag in httpd.conf is like this.


Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Satisfy all

I've just found that other AllowOverride None - I've changed it. Also, I've found that I did already have a table called 'users' in that database. The contents are still as they were before installation, so it hasn't overriden my data. I can delete that but how do I recreate the table? Thanks for your help.

cog.rusty’s picture

Are there any Drupal tables already created? If so you could drop them all and run drupal's install.php to create them again just to be sure that things are clean.

If you want to keep other existing tables you could specify a name prefix such as "dru_" for your Drupal tables (I think there is an "Advanced" section for this).

monkeyinquisition’s picture

Right, so I've dropped all the tables and recreated them using install.php. The initial problem, however, still persists - I still get the file and directory list. Thanks again for the help :)

cog.rusty’s picture

Damn... Perhaps if you put all those directives in httpd.conf Apache will find them more convincing that .htaccess files...

My own XAMPP httpd.conf contains:

<Directory "C:/Apache/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
# ...... etc
</Directory>

<IfModule dir_module>
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
</IfModule>

Other things to try:
- In /sites/default/settings.php uncomment and set your $base_url to 'http://localhost/drupal-5.2';
- In .htaccess, uncomment and set RewriteBase /drupal-5.2

(although I have never needed any of those, but some people say they helped)

pbarnett’s picture

Hi!

The relevant bit is

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
</IfModule>

as this tells Apache that index.php is a valid file to serve; httpd.conf typically only specifies index.htm and index.html, though XAMPP has this preconfigured.

monkeyinquisition’s picture

I've made all those changes and it's still the same. Would it help if I posted my http.conf? There may be some error in there from when I set up Apache...

cog.rusty’s picture

Oh, I think I should mention that Apache must be restarted every time you change httpd.conf, for the changes to take effect.

Just in case.

monkeyinquisition’s picture

Brilliant! Thanks very much. Having not restarted Apache throughout this whole process I don't know what it was that solved the problem, but at least it works now! Cheers.

ThompsonAlex’s picture

Thank you very much on this ^_^ it helps.