TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
Forums are in read-only mode while we transition to new software.
PHP Built-in webserver
  • I heard that future version ofPHP will have a built-in webserver, so you don't need to rely on Apache, nginx, etc. anymore.

    What do you think about this?

  • You'd still need apache, etc to test on. It would be stupid to not test on the actual software before deploying.

  • Install php and start coding but on the other hand will it be a security risk?

    I wonder which server configuration it will mimic.

  • @zombor You don't need Apache.

    The web server would be built into PHP and you could start it from cli like this: php -start localhost:80

  • Many apps use the Apache-specific .htaccess files to route traffic. I wonder how the PHP builtin webserver will deal with this? Or does it have its own format? Other than that: nice for quick installs and local testing! :)

    @feketegy: for real deploys I would still use Apache as a tested solution. I think the PHP internal webserver is merely meant for testing and local development...?

  • @feketegy

    I know that. But surely you wouldn't go straight from this php webserver in your local environment to apache in production without testing apache on your local machine?

  • The RFC is here: http://wiki.php.net/rfc/builtinwebserver (but currently down.) The idea of a built in server is to ease local development, you wouldn't use it in a production environment.

  • If the webserver component will be portable then I think it would be a great thing

  • I am also thinking about what feketegy said. Because I am trying to use php-fpm + nginx but if build in web server will cover apache or nginx, I don't need to learn about installation of php-fpm + nginx. I hope php would be all in one software

  • @katsuhiko I wouldn't bet on it. The built-in web server of PHP is for development purposes only. At least any sane developer would use it only in development :)

    Comparing PHP web server to nginx or even apache is like comparing the size of the Moon to the Sun. It's not same :)

  • Don't most people prefer to work in a development environment that closely mimics their production server?

  • I use the built in php web server when developing my demo app and it simplified it greatly. You should eventually run it in a local vm that mimics production.

  • I never had any difficulty or trouble setting up an Apache - it usually takes a couple of minutes. What kind of advantages are you getting from the PHP server? Is it the CLI? Don't you still have to configure things if you want to exclude an index.php from the URL as you would configure another server? Just curious about the real benefits of having PHP server, especially since you can't run it in production?

  • I mean of course not right now. in future I wish built in web server will be something like webrick of rails. no need configure to web server. only configure to php.ini. because apache can do many things, ip access limit, basic authorization, and so on. that is why many people make many kind of web server, like , ip access with firewall or php scripts or web server. web server should be more simple so that LAMP stack will be much easier to maintain. just in my opinion and in far future though

  • What kind of advantages are you getting from the PHP server? Is it the CLI? Don't you still have to configure things if you want to exclude an index.php from the URL as you would configure another server?

    I can just type this and I can test out what I'm working on: php -S localhost:8000 index.php URL rewrites just work.

  • I guess that makes it easier for making a debugger work too. I shall upgrade to 5.4 and give it a try :)

  • It works better with Kohana if you leave out the index.php - then it will serve static resources too.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion