Maybe this will help somebody out there...
I was having issues moving my site from the developer to enterprise edition so that I could go live with some new functionality.
I started by changing the login details to my enterprise login details and got the security token notification about having to apply for a token and append it to the login.
So, i got the token out of the mail they sent me, added it to the password and tried it out.
Which then produced another INVALID_LOGIN error.
I then remembered that I hadn't changed the wsdl to the non-developer version, so I downloaded and referenced these in the login script, but still got the same error.
So I went looking and found this link:
Community - Re: INVALID_LOGIN issue - Perl, PHP, Python & Ruby Development - Salesforce.com Community
Unfortunately I didn't have a character in the password that needed escaping, but I figured that maybe there was an issue with the IP being blocked.
Which led me to the Setup > Administration Setup > Security Controls > Network Access section of my online salesforce account
But, after adding my server's IP address, I still had the same error when connecting through the api.
Finally, I removed the security token from my password and everything worked.
I think possibly I had received an email about the IP banning and how to specify a trusted address, but ignored it as everything was still working in the developer account. There's honestly so much communication from salesforce nowadays that I ignore most of it.
Hope this helps somebody.