Welcome Guest, Not a member yet? Register   Sign In
For everybody that tests on localhost with windows(7)
#1

[eluser]geitvdplas[/eluser]
This problem is not Codeigniter related, but I'm posting this as a heads up.

If you are testing PHP scripts on windows 7 and all goes well until you try to load your database class, your page doesn't load and just hangs there and times out, resulting in a blank page, then this is for you.

The cause
Localhost does not point to 127.0.0.1 with windows7. In previous version of windows this was the case, but in windows7 it doesn't. Because of this; PHP cannot find the mysql (local)host!

Solution
However, you can easily do this yourself Smile
Add the following line to your hosts file (usually located at C:\Windows\System32\drivers\etc):
Code:
127.0.0.1       localhost

And you are done!

If you are using easyPHP for example, like me, you can now connect to your database with:
Code:
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "databasename";

I hope this will help someone.

Bye!


Messages In This Thread
For everybody that tests on localhost with windows(7) - by El Forum - 09-17-2010, 05:39 AM
For everybody that tests on localhost with windows(7) - by El Forum - 09-17-2010, 06:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB