0

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 ?

Community
  • 1
  • 1
chalasr
  • 12,971
  • 4
  • 40
  • 82
  • 8
    Its often easier to match the production environment to reduce unexpected bugs - for example testing htaccess rules is not going to work on php server. Also, being single threaded, you wont be able to test simultaneous connection code, such as ajax polling, on php server. Re the url thing, use hosts file and apache vhosts to access your local sites via `sitename.dev` rather than `localhost/sitename/` – Steve Nov 30 '15 at 22:37
  • I am working on multiple symfony based projects using a built in server and everything seems to be fine, never ran into any problem. I feel its more of a preference.. – Shairyar Dec 01 '15 at 05:56
  • as steve said, best to use a setup that matches your production setup, easiest way to do this is using a vagrant box. – Sam Janssens Dec 01 '15 at 07:44
  • Thank's everyone for your answers. – chalasr Dec 01 '15 at 16:28

1 Answers1

2

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.

Michael Sivolobov
  • 12,388
  • 3
  • 43
  • 64