tags:

views:

78

answers:

4

I'm starting to work with PHP more these days and I've been wondering what the best PHP webserver might be for a dev environment. Ideally, it would be easy to build, live only in the project deps directory and be easy to configure. Also, decent performance would be a plus.

In python land, werkzeug would be an equivalent of the type of server I'm thinking of.

+3  A: 

In my opinion, the best webserver for the dev environment is as close as you can come to exactly the webserver in production. PHP is a lot less 'stand-alone' in some cases then Python, and it prevents nasty errors and surprises when pushing code to the production server. All kinds of havoc can ensue when a $_SERVER array is just that essential bit different, or something runs as (fast)cgi instead of as a module.

Wrikken
so if you had to choose would you go with mod_php or fastcgi?
dcolish
@dcolish depends on the task. I'd recommend mod_php as it's way more familiar.
Col. Shrapnel
High performance dedicated server: mod_php. Shared server (either projects or people): fastcgi with suexec.
Wrikken
A: 

If you can, look at exactly how your production server(s) are setup and duplicate that exactly as your dev environment. If you can't, just use XAMPP/MAMP and try to stick fairly close to what your server has (compare phpinfo() dumps till you get them similar as regards extensions). The former is both better & much easier though, if you can access the server config files,

46Bit
A: 

Well, speaking of web servers, Apache is a state of art. Throw in a PHP module and you are set. That's all.

Col. Shrapnel
A: 

The web server is irrelevant for a development environment.

Whatever you like to use for your development: Eclpipse, NetBeans, Vim, xdebug, Firebug/FirePHP, "tail -f /var/log/syslog", phpTest,... all these can be used irregardless of whether you install, say, lightHttpd or Apache.

So, yes. As close to the production environment as possible is a good idea.

Avel