database error using virtual hosts |
[eluser]Unknown[/eluser]
Hi guys, I'm changing my projects for to use virtual hosts on windows seven, but when I changed my first codeigniter project to use virtual hosts, acessing the project I came across the following problem: A Database Error Occurred Unable to connect to your database server using the provided settings. Filename: D:\xampp\htdocs\project\system\database\DB_driver.php Line Number: 124 But if I access like old way: http://localhost/project, no has the error, the site opened ok. The other projects that don't using codeigniter are ok too. This is happening with only codeigniter projects. Anybody already had the same problem or knows how to solve it? Thanks for any helps.
[eluser]InsiteFX[/eluser]
Did you edit the windows 7 host file and add a host to it? You will need admin rights to do it Code: C:\Windows\System32\drivers\etc\hosts
[eluser]CroNiX[/eluser]
Could it be your ENVIRONMENT setting, or some config based on ENVIRONMENT? How are you detecting/setting the ENVIRONMENT in index.php?
[eluser]Unknown[/eluser]
CroNiX. You are right! My environment configuration was not checking the new url that I set the virtual host. Thankssss.
[eluser]CroNiX[/eluser]
I check for production and testing server, and default to development. Then that won't matter, and it's also useful if you have multiple developers. Code: switch($env) |
Welcome Guest, Not a member yet? Register Sign In |