Skip to content

Instantly share code, notes, and snippets.

@pstaender
Last active September 20, 2022 07:15

Revisions

  1. pstaender revised this gist Sep 18, 2022. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions using_php_built-in-server_with_silverstripe.md
    Original file line number Diff line number Diff line change
    @@ -12,13 +12,12 @@ Just start now the server with:
    $ vendor/bin/serve
    ```

    ## Nice to have: composer command
    ## Nice to have: A server composer command

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

    ```json
    {
    …,
    "scripts": {
    "server": [
    "Composer\\Config::disableProcessTimeout",
  2. pstaender created this gist Sep 18, 2022.
    39 changes: 39 additions & 0 deletions using_php_built-in-server_with_silverstripe.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    # Using the PHP built-in-server with SilverStripe v4+

    In your SilverStripe project (the [original module can be found here](https://github.com/silverstripe/silverstripe-serve/)):

    ```sh
    $ composer require pstaender/silverstripe-serve
    ```

    Just start now the server with:

    ```sh
    $ vendor/bin/serve
    ```

    ## Nice to have: composer command

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

    ```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
    ```