Search code examples
phpapachesymfonyphp-builtin-server

Is it better to use PHP built-in server or apache2 for Symfony2 dev environment


What is the better approach for keep a long-term stable dev environment ?

Should I prefer use server:runor my apache2 server on app_dev.php for develop ?

Because I work on client side , I know how much use a non-fixed base url can be ambiguous and cause surprises in production, also I think it's more simple to use PHP built-in server, and it's easy for start/stop/restart.

But a collaborator said the opposite, because :

It's more a production-like environment, and it's more stable for long term development.

Symfony cookbook said :

The preferred way to develop your Symfony application is to use PHP's internal web server. However, when using an older PHP version or when running the application in the production environment, you'll need to use a fully-featured web server.

http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html

But what is the right way ?

EDIT: I do not ask for opinions but real facts and to know how to get more stability in my development workflow

So, my question is :

Which of these approaches will provide me with the closest dev environment from production ?


Solution

  • PHP built-in web-server is very laggy. It is "preferred way" because it can be set up at the moment. You don't need to set up virtual hosts, configs and other stuff. You just run one command. And can develop at the moment.

    If you have already configured web-server and can add project to be delivered by it then I would recommend you to use this approach. Because you will have more stable and faster environment.