Remove xdebug installation - #35667
Conversation
Removing Xdebug since it is already installed in the `wordpress` image. Closes #34320
|
@noahtallen, would you please review this pull request? It fixes issue #34320, which has repeatedly blocked development and deployment. The underlying issue is that the |
|
@brylie Thanks for the contribution, and I'm sorry for the pain this is causing. What if we instead used this code: - RUN pecl install xdebug && docker-php-ext-enable xdebug
+ RUN if [ -z "$(pecl list | grep xdebug)" ] ; then pecl install xdebug ; fi
+ RUN docker-php-ext-enable xdebugHere's my testing results via # If the package exists, it will not attempt to install xdebug and exits with 0
root@bbf41d59e0c0:/var/www/html# if [ -z "$(pecl list | grep xdebug)" ] ; then pecl install xdebug ; fi
root@bbf41d59e0c0:/var/www/html# echo $?
0
# If the package does not exist, it will attempt to install xdebug. This will obviously work in general, but demonstrates that pecl is getting executed.
root@bbf41d59e0c0:/var/www/html# if [ -z "$(pecl list | grep foo)" ] ; then pecl install xdebug ; fi
pecl/xdebug is already installed and is the same as the released version 3.1.1
install failed
root@bbf41d59e0c0:/var/www/html# echo $?
1
# We can run docker-php-ext-enable without getting an exit code of 1
root@bbf41d59e0c0:/var/www/html# docker-php-ext-enable xdebug
warning: xdebug (xdebug) is already loaded!
root@bbf41d59e0c0:/var/www/html# echo $?
0This should prevent it from crashing in the scenario you're getting My two concerns with this PR are:
That's why I think fixing the error in question would be a safer approach for the time being, and hopefully get everything working for you! I will also take a look at your PR conditionally installing Xdebug, since I agree that is a better approach in general. |
|
Sure, the fix sounds reasonable. I am encountering this issue when switching between projects that use wp-env where wo-env may not have been stopped properly in one project. Similarly, when introducing a syntax error in a project with wo-env that causes the container build to fail subsequently running |
@noahtallen I'll close this pull request as I've incorporated your suggestion(s) into PR #34324 |

Removing Xdebug since it is already installed in the
wordpressimage.Closes #34320
Description
The
@wordpress/envDocker image is having recurring issues when trying to install Xdebug, as outlined in #34320. While discussing the Xdebug errors, we discovered that thewordpressimage, used by@wordpress/envalready contains Xdebug. Hence, the installation errors observed in issue #34320This pull request removes the conflicting Xdebug installation.
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.jsfiles for terms that need renaming or removal).