Skip to content

Commit

Permalink
too much max_nesting_level
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Apr 11, 2017
1 parent 9283347 commit 6c64b38
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 8 deletions.
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ app:
- "8080:8080"
volumes:
- .:/app
command: "php -S 0.0.0.0:8080"
command: "php -S 0.0.0.0:8080 -t /app/public"
```
```bash
Expand All @@ -113,7 +113,7 @@ docker run -v `pwd`:/app juliangut/phpdev:latest composer [command]
docker exec -it [container_id] /bin/bash
```

### Starting an xDebug session
### Using xDebug

It is **not** recommended to have a fixed remote session identifier and an auto-started remote session using "XDEBUG_IDE_KEY" and "XDEBUG_REMOTE_AUTOSTART".

Expand All @@ -132,6 +132,54 @@ To activate the trace set "XDEBUG_TRACE" cookie. Trace files will be saved into

> There are [browser plugins/extensions](https://xdebug.org/docs/remote#starting) to toggle this cookies easily.
#### Debugging with PHPStorm

##### Review xDebug configuration

![xDebug configuration](img_xdebug_config.jpg)

* Port must be the same previously defined in `XDEBUG_REMOTE_PORT`

##### Create a server

![server configuration](img_server_config.jpg)

* Name will be used later, so make it relevant
* Host and port must be the same set in built-in server
* Map your project root to container location (/app)

##### Start listening for xDebug

Click the phone icon to start listening

![start listening](img_debug_listen.jpg)

##### Start the container

Setting `PHP_IDE_CONFIG` environment variable to the server name you defined earlier

```bash
docker run -d -p 8080:8080 -v `pwd`:/app -e PHP_IDE_CONFIG="severName=Test" juliangut/phpdev:latest php -S 0.0.0.0:8080 -t /app/public
```

##### Using Docker Compose

```yaml
app:
image: juliangut/phpdev:latest
ports:
- "8080:8080"
environemnt:
- PHP_IDE_CONFIG: "severName=Test"
volumes:
- .:/app
command: "php -S 0.0.0.0:8080 -t /app/public"
```
```bash
docker-compose up
```

## Extending the image

The image comes with just the minimum PHP extensions, you most probably will need more.
Expand Down
1 change: 0 additions & 1 deletion fpm/5.6/xdebug.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ xdebug.profiler_output_dir = /var/log/php
xdebug.auto_trace = 0
xdebug.trace_enable_trigger = 1
xdebug.trace_output_dir = /var/log/php
xdebug.max_nesting_level = 1000
;xdebug.idekey = PHPSTORM
1 change: 0 additions & 1 deletion fpm/7.0/xdebug.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ xdebug.profiler_output_dir = /var/log/php
xdebug.auto_trace = 0
xdebug.trace_enable_trigger = 1
xdebug.trace_output_dir = /var/log/php
xdebug.max_nesting_level = 1000
;xdebug.idekey = PHPSTORM
1 change: 0 additions & 1 deletion fpm/7.1/xdebug.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ xdebug.profiler_output_dir = /var/log/php
xdebug.auto_trace = 0
xdebug.trace_enable_trigger = 1
xdebug.trace_output_dir = /var/log/php
xdebug.max_nesting_level = 1000
;xdebug.idekey = PHPSTORM
Binary file added img_debug_listen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_server_config.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_xdebug_config.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion php/5.6/xdebug.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ xdebug.profiler_output_dir = /var/log/php
xdebug.auto_trace = 0
xdebug.trace_enable_trigger = 1
xdebug.trace_output_dir = /var/log/php
xdebug.max_nesting_level = 1000
;xdebug.idekey = PHPSTORM
1 change: 0 additions & 1 deletion php/7.0/xdebug.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ xdebug.profiler_output_dir = /var/log/php
xdebug.auto_trace = 0
xdebug.trace_enable_trigger = 1
xdebug.trace_output_dir = /var/log/php
xdebug.max_nesting_level = 1000
;xdebug.idekey = PHPSTORM
1 change: 0 additions & 1 deletion php/7.1/xdebug.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ xdebug.profiler_output_dir = /var/log/php
xdebug.auto_trace = 0
xdebug.trace_enable_trigger = 1
xdebug.trace_output_dir = /var/log/php
xdebug.max_nesting_level = 1000
;xdebug.idekey = PHPSTORM

0 comments on commit 6c64b38

Please sign in to comment.