2

I installed a fresh copy of Symfony on my localhost at htdocs\symfony-fresh and the file structure is: enter image description here

Now I run the following in git bash:

$ php bin/console server:run

then I was suggested to browse at 127.0.0.1:8000 to see the fresh installation of symfony. It works like a charm. But one day later I browse at 127.0.0.1:8000 and I can see the following error message:

This site can’t be reached
127.0.0.1 refused to connect. 

It seems server is offline. I checked my apache & Mysql is running. enter image description here

Then I tried to run the command again:

$ php bin/console server:run

But same problem is going on. I am new in Symfony and enjoying to learn, but this problem stuck me. What should I do to run this app browsing at 127.0.0.1/symfony-fresh or localhost/symfony-fresh?

2 Answers 2

3

You should check status follow:

php bin/console server:status

By default, the web server listens on port 8000 on the loopback device. You can change the socket passing an IP address and a port as a command-line argument:

# passing a specific IP and port
php bin/console server:start 192.168.0.1:8080

# or like this
php bin/console server:start *:8080 
Sign up to request clarification or add additional context in comments.

Comments

0

Apache has nothing to do with this, the built in Symfony server is based on php built in server (php -S ...)

The built in server is intended for development use only, you must run the command every time the server has stopped or the machine has rebooted.

If you want to use Symfony with apache you can setup a virtualhost: https://symfony.com/doc/current/setup/web_server_configuration.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.