Skip to content

Instantly share code, notes, and snippets.

@pstaender
Last active September 20, 2022 07:15
Show Gist options
  • Save pstaender/2db4d55f7623b43b96673922a6e0d68f to your computer and use it in GitHub Desktop.
Save pstaender/2db4d55f7623b43b96673922a6e0d68f to your computer and use it in GitHub Desktop.
Using the PHP built-in-server with SilverStripe v4+

Using the PHP built-in-server with SilverStripe v4+

In your SilverStripe project (the original module can be found here):

  $ composer require pstaender/silverstripe-serve

Just start now the server with:

  $ vendor/bin/serve

Nice to have: A server composer command

To start the server with composer server, add to your composer.json:

{
    "scripts": {
        "server": [
            "Composer\\Config::disableProcessTimeout",
            "@php serve"
        ]
    },
}

XDebug

You have to add those lines to your php.ini (check with phpinfo() the correct path of php.ini the built-in-server relies on):

xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.discover_client_host=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment