Automate xdebug installation and simplify instructions (#1630)
This commit is contained in:
parent
4673ba7b31
commit
600a6154b4
|
@ -277,44 +277,17 @@ docker-compose build workspace
|
||||||
|
|
||||||
1 - First install `xDebug` in the Workspace and the PHP-FPM Containers:
|
1 - First install `xDebug` in the Workspace and the PHP-FPM Containers:
|
||||||
<br>
|
<br>
|
||||||
a) open the `docker-compose.yml` file
|
a) open the `.env` file
|
||||||
<br>
|
<br>
|
||||||
b) search for the `INSTALL_XDEBUG` argument under the Workspace Container
|
b) search for the `WORKSPACE_INSTALL_XDEBUG` argument under the Workspace Container
|
||||||
<br>
|
<br>
|
||||||
c) set it to `true`
|
c) set it to `true`
|
||||||
<br>
|
<br>
|
||||||
d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container
|
d) search for the `PHP_FPM_INSTALL_XDEBUG` argument under the PHP-FPM Container
|
||||||
<br>
|
<br>
|
||||||
e) set it to `true`
|
e) set it to `true`
|
||||||
|
|
||||||
It should be like this:
|
2 - Re-build the containers `docker-compose build workspace php-fpm`
|
||||||
|
|
||||||
```yml
|
|
||||||
workspace:
|
|
||||||
build:
|
|
||||||
context: ./workspace
|
|
||||||
args:
|
|
||||||
- INSTALL_XDEBUG=true
|
|
||||||
...
|
|
||||||
php-fpm:
|
|
||||||
build:
|
|
||||||
context: ./php-fpm
|
|
||||||
args:
|
|
||||||
- INSTALL_XDEBUG=true
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
2 - Open `laradock/workspace/xdebug.ini` and `laradock/php-fpm/xdebug.ini` and enable at least the following configurations:
|
|
||||||
|
|
||||||
```
|
|
||||||
xdebug.remote_autostart=1
|
|
||||||
xdebug.remote_enable=1
|
|
||||||
xdebug.remote_connect_back=0
|
|
||||||
; NOTE: The dockerhost is your vEthernet (DockerNAT) IP
|
|
||||||
xdebug.remote_host=dockerhost
|
|
||||||
```
|
|
||||||
|
|
||||||
3 - Re-build the containers `docker-compose build workspace php-fpm`
|
|
||||||
|
|
||||||
For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm) or follow up on the next section if you use linux and PhpStorm.
|
For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm) or follow up on the next section if you use linux and PhpStorm.
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,10 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
||||||
# Copy xdebug configuration for remote debugging
|
# Copy xdebug configuration for remote debugging
|
||||||
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||||
|
|
||||||
|
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
||||||
|
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
||||||
|
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /usr/local/etc/php/conf.d/xdebug.ini
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Blackfire:
|
# Blackfire:
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
|
@ -238,6 +238,10 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
||||||
# ADD for REMOTE debugging
|
# ADD for REMOTE debugging
|
||||||
COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
|
COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
|
||||||
|
|
||||||
|
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
|
||||||
|
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
|
||||||
|
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Blackfire:
|
# Blackfire:
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
Loading…
Reference in New Issue