Keeping the Symfony2 Embedded Server Dead

I use bin/console server:run(or app/consolefor the Sf2 directory structure) to develop applications using Symfony2. Unfortunately, on several systems, it dies in the end (usually due to segfault).

I tried several versions of PHP and operating systems (5.5, 5.6 on Ubuntu 14.10 and 15.04, OS X 10.9 and 10.10).

I reported errors and continue to work, but it annoys me that I have to periodically restart the server manually.

I tried to do something like this as a "build target":

until bin/console server:run -v; do \
sleep 1; \
done

But, unfortunately, it only works occasionally (I have not yet determined the reason why it did not restart the server).

Can you recommend another way to save this server preferably without changing the global services / daemons?

+4
source share
2 answers

I managed to get this to work using forever.js .

It was nothing fantastic, just

forever start server.sh # sh contains bin/console server:run -v

This question turned out to be very useful, since I could also include accessory watches and a couple of other things.

+1
source

You can use some monitoring software to ensure that the process always works. Check out superisord ( http://supervisord.org/ )

You need to specify a similar task to run:

[program:server] command=bin/console server:run -v directory=/var/www/symfony-dir autostart=true autorestart=true

Additional information on flags and examples at http://supervisord.org/configuration.html#program-x-section-settings

, , :)

+1

Source: https://habr.com/ru/post/1584859/


All Articles