4

I want to use server of symfony,to close my apache2 at first.

service apache2 stop

My command history in symfony:

symfony new myblog lts
cd /home/debian8/myblog
php app/console server:run  -vvv
[2016-03-19 15:14:11] php.DEBUG: fsockopen(): unable to connect to 127.0.0.1:8000 (Connection refused) {"type":2,"file":"/home/debian8/myblog/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php","line":59,"level":28928}


 [OK] Server running on http://127.0.0.1:8000


 // Quit the server with CONTROL-C.
  RUN  '/usr/bin/php5' '-S' '127.0.0.1:8000' '/home/debian8/myblog/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/router_dev.php'
  ERR  [Sat Mar 19 15:14:36 2016] 127.0.0.1:36496 [200]: /
  ERR  [Sat Mar 19 15:14:37 2016] 127.0.0.1:36497 [200]: /_wdt/cf9a53
  ERR  [Sat Mar 19 15:14:37 2016] 127.0.0.1:36498 [200]: /favicon.ico
  ERR  [Sat Mar 19 15:14:37 2016] 127.0.0.1:36499 [200]: /favicon.ico
  ERR

Some material say it is the fact that port 8000 don't listen on result in the problem.
How to set the builtin dev server in symfony properly?

showkey
  • 482
  • 42
  • 140
  • 295

1 Answers1

1

If you look on how the fsockopen is used in server command (latest), you will see that it's used to make sure that nothing is listening on the port. It uses silence operator, but it still may be possible the raise warning if your php setup uses scream to override it.

The warning says - "there is nothing there" which is what's supposed to happen. Only the warning should not be raised due to the @ silence operator.

Tomáš Fejfar
  • 11,129
  • 8
  • 54
  • 82