-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
localhost vs 127.0.0.1, former works only in page, latter only in CLI. #1693
Comments
what happens with localhost:8889 ? |
with localhost:8889 CLI works, but the project still does not work. |
This is not a Symfony issue but a local or Doctrine one. |
@robo47 thanks, it seems like its what i need, except symfony 2 won't take the same config options that symfony 1 used to take; less i be mistaken. If i put in any of the following; it thinks the whole thing is just the hostname and ignores the options: What would be the proper format? I am still playing with the values but nothing is working thus far. |
Take a look at symfony/symfony-standard#151. |
The proper way is to set a |
For anyone else using MAMP, found the solution to be, upgrade to MAMP 2.0, go to preferences, then go to 'ports' then click "Set to default Apache and MySQL ports" button. Wait for MySQL and Apache to restart. Once it has restarted set your symfony apps preferences.ini host to 127.0.0.1, no need to specify a port. It should work then no both the browser and your CLI. Just incase you changed any configs, it should set default ports of 80 for Apache, (i had 8888 which is wrong.), and mySQL should be 3306 (i had 8889 which is wrong). Sorry for any inconvenience this caused anyone trying to diagnose issue, and i am very grateful for your help. |
Commits ------- ac65cfb Add a way to easily specify database connection port Discussion ---------- Add a way to easily specify database connection port --------------------------------------------------------------------------- by lenar at 2011/07/14 14:43:12 -0700 Related to symfony/symfony#1693.
Commits ------- ac65cfb Add a way to easily specify database connection port Discussion ---------- Add a way to easily specify database connection port --------------------------------------------------------------------------- by lenar at 2011/07/14 14:43:12 -0700 Related to symfony/symfony#1693.
When using the parameters.ini file, setting the database_host to 127.0.0.1:8889, the page will not load, and gives an error of:
"SQLSTATE[HY000] [2005] Unknown MySQL server host '127.0.0.1:8889' (1)", however, it does work with the CLI when doing things such as 'php app/console doctrine:schema:update --force' for example.
If you do the inverse, and set the databse_host to 'localhost', then the issue is reversed, the project page starts working again with no errors but the CLI stops working with the database.
I am using the commonly used MAMP (http://www.mamp.info/en/index.html) on Mac OS X 10.6.8. Though i doubt that bares too much relevance.
so in summary:
database_host="localhost" <-- CLI Does Not Work, Project Works.
database_host="127.0.0.1:8889" <-- CLI Works, Project Does Not Work.
Your concerns are appreciated.
Thanks, Reece.
The text was updated successfully, but these errors were encountered: