New in 4.0: Support of PHP 5.4 Built-in Web Server

As of PHP 5.4.0, the CLI SAPI provides a built-in web server which is intended for development purposes only. We are glad to announce that since PhpStorm 4.0 you can control a web server instance directly from the IDE.

To start working with the PHP built-in web server, first create a ‘PHP Built-in Web Server’ run configuration.

‘PHP Built-in Web Server’ run configuration

‘PHP Built-in Web Server’ run configuration editor

The “Host”, “Port”, and “Document root” fields are mandatory, the “Router script” field is optional. A ‘router script’ is a script which is run for each HTTP request. If this script returns ‘FALSE’ ,the requested resource is returned as-is. Otherwise the script’s output is returned to the browser.

Please see the official documentation for details.

Before launching the run configuration, make sure that that PHP interpreter, version 5.4 or higher is selected in your project settings.

Selected PHP interpreter version

Otherwise launching the run configuration fails.

Error message on attempt to run built-in web server using an incompatible PHP interpreter

Download the latest PhpStorm & WebStorm 4.0 EAP. We’d also love to get your feedback in the issue tracker

Develop with pleasure!

This entry was posted in Cool Feature, PhpStorm and tagged , . Bookmark the permalink.
  • Jason Rundell

    So does the Built-in Web Server replace tools like WAMP/XAMPP/MAMP/Apache?

    • nnmatveev

      WAMP/XAMP/MAMP – aren’t just web-servers. They also contain database/FTP and so on. Built-in Web Server could be a replacement for Apache only.

  • Ivan Ivanov

    What about the debugging with the built-in server ? Does phpstorm provide this feature ?

    • nnmatveev

      Yes, but it is up to your PHP interpreter configuration. You need to configure Xdebug or Zend Debugger for your PHP CLI. Please note that only Xdebug 2.2RC1 is available for PHP5.4 now.

      • chankit

        Xdebug 2.2RC1 works with PHP 5.4 in CLI, but apparently it won’t work when started with built-in web server, or PhpStorm 4 Beta doesn’t support it.