-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Default (4000) port busy #962
Comments
As a sanity check, can you change the port in dev.exs to something else, say 4004 and see if it works? |
Of course I can and I did. But I think it will be better to pass port number in terminal. I think this way is more obvious for new people outside elixir ecosystem. If you agree thats nice, if you don't agree thats ok. |
So something must be taking up port 4000 on your system. To achieve what you want, you can simply default to config :my_app, MyApp.Endpoint,
http: [port: System.get_env("PORT") || 4000], |
The you can dynamically set the port with:
|
thanks a lot |
How do you give this command in Windows? |
I think it is:
|
Thanks Jose. |
Tried all the options above and changed the port number in dev file. But the terminal is getting hung while executing mix phoenix.server mix phoenix.server The below is my mix.exs file. defmodule App.Mixfile do def project do Configuration for the OTP application.Type
|
@Radhika-Adoni everything looks fine. Is the app accessible at the port you are using? If you were wanting an |
Used this command..and the issue got resolved :) MIX_ENV=prod PORT=80 iex -S mix phoenix.server..used port 80.. |
Its one week into Elixir and my first Functional Programming language and I am loving it.. |
Hello Chris The command is working for prod environment but for dev mix phoenix.server is still getting hung. |
You can use something like |
or you can just do |
That only works if it is a beam program that has port 4000, in addition it will kill all other beam programs as well, and it only works on *nix-like OS's (and even then not all as technically killall is nonstandard). |
I am missing something probably but I cannot make it work. Then tries: Running: How can I define default port to 8081 while make it still possible to configure it from command line? |
You most likely did not configure the |
I am sure and I think I have found the answer. |
yes |
To be clear, the 2nd one, in a separate mix config would be merged with the prior one |
May be helpful for people finding this later. Running In my particular case it was a NoMachine (nx) service running there. |
I am using OS X and I have tried (many time with computer restarts) to run phoenix server on port 4000 and each time I receive information:
Port 4000 isn't busy because in other time I can use this port to run other apps (in different language).
I am using the latest phoenix framework version and Elixir 1.0.4.
Maybe you can add support to OPTIONAL port numer in config (for development environment). When I changed config and pass port 4001, application have started without problems.
The text was updated successfully, but these errors were encountered: