My smtp settinsg in php.ini :
[mail function]
; For Win32 only.
SMTP =localhost
smtp_port = 1025

; For Win32 only.
sendmail_from = admin@localhost.com

I cannot login.

Comments

ezheidtmann’s picture

Why do you think your SMTP settings have something to do with being able to login?

Brian@brianpuccio.net’s picture

Additionally, do you run a local mail server?

promete’s picture

Do you mean there is no need to have an SMtp server? I am working on drupal just for 2 weeks .So i need really help about drupal and php etc..

Brian@brianpuccio.net’s picture

A SMTP server is one that you can send mail through. Drupal has PHP send an email with the passwords of the users as they sign up.

With respect to you being unable to login, can you give us the steps you went through from the start and tell us exactly what went wrong?

promete’s picture

I installed apache, php, mysql on Windows XP. There is no problem until here. Then I copied contents of drupal folder(4.6) into htdocs under apache. First i had a problem with database.

"mysql -u user -p create drupal " comand didn't work in mysql command line. SO i had to create database and user with query browser. And then the turn was intalling database.mysql to my database. I opened database.mysql file and copied all and run as a query so that i mport the database. Now i have an user in users table. username: admin pass: 123456.

I could finally open index.php file. And clicked create first account.
an error occured :mailfunction error. But it gave ma password. Nor when used username and password , it says wrong pasword. SO i have to click "forgetten your pass". I wrote my email and clicked. It says:

Fatal error: Call to undefined function user_mail_wrapper() in C:\Apache2\htdocs\modules\user.module on line 346

What is wrong? Please help

LukeLast’s picture

jj24’s picture

only took me 5+ hours to find the answer -
how simple, yet how needle-in-haystack-ish.

and of course, after trying some "smtp tricks" and such -
and of course, after posting my own thread in exasperation -

and finally, of course, allow me to join the burgeoning chorus - please make this part of the installation!!!!

Brian@brianpuccio.net’s picture

OK, firstly, the command mysql -u user -p create drupal that you ran does the following: logs in with the mysql user "user", prompts you for the password for the mysql user called "user" and creates the database "drupal". You cannot run this command as is. You would need to substitute your mysql user name that you've set up. That's why this didn't work.

Using the query browser, I'm guessing is a sort of graphical configuration tool? (I'm sorry, but I don't currently have access to a Windows machine) Anyhow, creating a mysql user and a database with this method is fine.

Next, you have to tell your Drupal configuration what the mysql user name and mysql password are. In the file /drupal_install_directory/sites/default/settings.php, there is a line you must edit. The line currently reads $db_url = 'mysql://username:password@localhost/database';, you need to fill in the mysql user name, the mysql user's password, leave localhost the same since you are running the mysql server on the same machine you are running apache, and lastly, fill in the name of the database that you created and dumped all of that data in to.

Now this far along, the user table inside the database will have just one entry, and it will have the user ID (also know as UID) of 0. This is not a person you can sign in as, this is an anonymous person.
Next, you pointed your web browser at your local Drupal install. It should have looked something like this:

Welcome to your new Drupal-powered website. This message will guide you through your first steps with Drupal, and will disappear once you have posted your first piece of content.

The first thing you will need to do is create the first account. This account will have full administration rights and will allow you to configure your website. Once logged in, you can visit the administration section and set up your site's configuration.

Drupal comes with various modules, each of which contains a specific piece of functionality. You should visit the module list and enable those modules which suit your website's needs.

Themes handle the presentation of your website. You can use one of the existing themes, modify them or create your own from scratch.

We suggest you look around the administration section and explore the various options Drupal offers you. For more information, you can refer to the Drupal handbooks online.

Next, you should have clicked the "create the first account" link. After filling in your desired username as well as your email address, you should have seen a screen that reads something like:

Welcome to Drupal. You are user #1, which gives you full and immediate access. All future registrants will receive their passwords via e-mail, so please configure your e-mail settings using the Administration pages.

Your password is e98q8uGZcc. You may change your password on the next page.

Please login below.

I believe this is where you saw your error regarding the lack of a mail server. You most likely aren't running a mail server on your computer in addition to the Apache server and mysql servers you just set up. Drupal needs access to a SMTP server to send emails out to users to inform them of their passwords, except when the first user signs up. The username you gave Drupal and the password it gave you in response should allow you to log in to the website. If you use the grpahical mysql tool you used before the create the database and look at the user table, you should be able to confirm this.

Alternatively, your PHP configuration may not have the mail function. I'd help you more here, but I don't have access to a Windows machine and I have never attempted to run Drupal on Windows.

The solution that Luke has offered would work, except to turn the module on, you would need to login first, which you are saying you can't do because the user name you selected and the password Drupal generated don't work.

Alternatively, you can read this thread where this error is discussed. It seems that if you follow the steps outlined here your Drupal install will be able to send email.

You might, however, need to point it at your ISP's mail server since you yourself probably aren't running one. Please disregard this part if I am wrong and you are indeed running your own mail server.

promete’s picture

The steps occured just like you told above until "except when the first user ....." I got a password but with a SMTP error. But i cannot remember what it was exactly.Anyway I wrote down the password. But when I tried to log in with it it says:

"Sorry. Unrecognized username or password. Have you forgotten your password?"

Shoul i install everything from the beginning? Because there is another error. When i try to get localhost or relog in it says:

Fatal error: Duplicate entry '222ea0d830018d2221db12d71fe94016' for key 1 query: INSERT INTO sessions (sid, uid, hostname, timestamp) VALUES ('222ea0d830018d2221db12d71fe94016', 0, '127.0.0.1', 1127079168) in C:\Apache2\htdocs\includes\database.mysql.inc on line 66

SO everytime i emtpy sessins table to solve it

sepeck’s picture

If you do not point to an SMTP server in your php.ini file, then you will get an erroron any function that attempts to send email.

When you create the first user, right after you click the login button, hit the edit tab and change your password.

If you are playing with the site for the first time and this is a new install, then it might be worth it to run through the install again for practise. You will be able to pay more attention now that you have been through it once.

Also, hit the Left hand link in my sig for some quick reading.

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

trantt’s picture

When you create the first user, right after you click the login button, hit the edit tab and change your password."

sepeck,
I couldn't able to locate this tab. How do you get to it?

Also,

when running drupal/index.php from my local apache webserver, there are some weird php tag on top of index.php page, can you tell me what it is:

{head} {styles} {_BLOCK_.header.logo} {_BLOCK_.header.site_name} {secondary_links}
{primary_links}
{_BLOCK_.header.search_box}

Welcome to your new Drupal-powered website. This message will guide you through your first steps with Drupal, and will disappear once you have posted your first piece of content.

The first thing you will need to do is create the first account. This account will have full administration rights and will allow you to configure your website. Once logged in, you can visit the administration section and set up your site's configuration.

Drupal comes with various modules, each of which contains a specific piece of functionality. You should visit the module list and enable those modules which suit your website's needs.

Themes handle the presentation of your website. You can use one of the existing themes, modify them or create your own from scratch.

We suggest you look around the administration section and explore the various options Drupal offers you. For more information, you can refer to the Drupal handbooks online.

also, when creating the first user, I also recieved a few weird php tags as well

warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 587, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:\PhPDevl\drupal\modules\user.module on line 374.

{head} {styles} {_BLOCK_.header.logo} {_BLOCK_.header.site_name} {secondary_links}
{primary_links}
{_BLOCK_.header.search_box}
{_BLOCK_.header.title}
Your password and further instructions have been sent to your e-mail address.

Thanks
Trantt

sepeck’s picture

Something is not processing correctly. Those are variables and they should have values. You are running php5 something? xTemplate has had trouble with higher versions

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

trantt’s picture

sp,

should I switch to php4 instead of 5?

sepeck’s picture

That would be one option to try if it's easy. The other option would be to switch to a phpTemplate based theme to see if the issue goes away. The final would be to troubleshoot identify, correct and submit patches :).

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

trantt’s picture

sp,

I loaded php 441 into my machine and the drupal pages look much better than what I used to have... Regarding to your phpTemplate based theme, how can I switch it back (just say I'm still using php5) to the based theme? I received the unathorized message when click on the theme button. Anyway, I'm very thankful for your help, I don't think I can get this far without your help...

btw, is it possible to step through php code? what tool should i use for it?

Thanks
trantt

trantt’s picture

sp,

"When you create the first user, right after you click the login button, hit the edit tab and change your password."

How can I manage to pass the log in page when I don't have a password?

Thanks
trantt

sepeck’s picture

Because when you create the first account it A, shows you the password and B, presents a button that says log in. Have you tried it yet and just missed it?

UID1, the first account, is special because you have to be able to log in to your site when you don't have any other accounts.

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

trantt’s picture

sp,

I got it, like you said, the admin uid has to be 1, otherwise, it is not going to work (I kept deleting and recreating the same user)...

Once again, thank you very much for your help... I don't think I can get this far w/o your help...

Trantt

trantt’s picture

sepeck,

I've no idea how to create a test site with drupal, can you walk me through it? I created a new topic under http://drupal.org/node/42994

Please help

Thanks

trantt

promete’s picture

After i created first user, i clicked login button. Then "You are not authorized" page appeared. What is the ptoblem i cannot understand. Thanks in advance

trantt’s picture

promete,

I had the same problem and I was able to resolve it (with sp help). Here was my problem and how I fixed it:

1. the first account needs to be 1, otherwise, it is not going to work..

2. Please look on your users table and making sure your id was assigned to 1. if not, please delete it (also delete the same record on user_role table

3. go to your sequences table and reset users_uid's id to 0

4. Recreate your first user.

Hope this help...

trantt

chx’s picture

Well, the Drupal developers are all omniscient and clairvoyant so we could easily discover what's going on an anonymous computer thousands of miles away but using our superhuman powers are -- alas -- is very tiring so we prefer to read detailed reports instead of "I can not login".
--
Read my developer blog on Drupal4hu.

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.