-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Extend description of debugging CLI command on Pro Staging and Production #6934
Conversation
An admin must run tests on this PR before it can be merged. |
src/cloud/howtos/debug.md
Outdated
@@ -325,6 +325,16 @@ php -d xdebug.profiler_enable=On -d xdebug.max_nesting_level=9999 ... | |||
|
|||
If you expect to use SSH and debug multiple times, you can put the export commands into a bash script in the `/tmp` directory to run them each time. | |||
|
|||
## Debug CLI commands for Pro Staging and Production {#pro-debugcli} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating a separate section, I think it's better to include the information inline in the existing section. However, the instructions in that section were a bit disjointed which makes it hard to integrate new content. I suggest replacing the entire section, starting at line 301 with the content below the ----. If the suggested revision introduced any technical errors or confusion, let's discuss.
Debug CLI commands {#debugcli}
When you debug CLI commands, you must configure environment variables to enable Xdebug. These variables are removed when the SSH session ends. If you expect to debug over multiple SSH sessions, add the export commands for the variable configuration to a bash script in the /tmp
directory to run each time you start a session.
{:.procedure}
To enable Xdebug for debugging CLI commands:
-
SSH to the environment you want to debug.
-
Configure environment variables:
export XDEBUG_CONFIG='PHPSTORM'
export PHP_IDE_CONFIG="serverName=<name of the server that is configured in PHPSTORM>"
Optionally, add Xdebug runtime options to the environment variable configuration.
php -d xdebug.profiler_enable=On -d xdebug.max_nesting_level=9999 ...
-
Begin debugging.
On Starter environments and Pro Integration environments, run the CLI command to debug, for example:
php bin/magento cache:clean
On Pro Staging and Production environments, you must specify the path to the Xdebug php configuration file when debugging CLI commands, for example:
php -c /etc/platform/USERNAME/php.xdebug.ini bin/magento cache:clean
src/cloud/howtos/debug.md
Outdated
1. Begin debugging | ||
|
||
On Starter environments and Pro Integration environments, run the CLI command to debug. | ||
You may add runtime options, for example: | ||
|
||
```bash | ||
php -d xdebug.profiler_enable=On -d xdebug.max_nesting_level=9999 bin/magento cache:clean | ||
``` | ||
|
||
On Pro Staging and Production environments, you must specify the path to the Xdebug php configuration file when debugging CLI commands, for example: | ||
|
||
If you expect to use SSH and debug multiple times, you can put the export commands into a bash script in the `/tmp` directory to run them each time. | ||
```bash | ||
php -c /etc/platform/USERNAME/php.xdebug.ini bin/magento cache:clean | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like lines 325 - 336 are indented one space too far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right. There were 4 spaces instead of 3. Fixed
Co-Authored-By: Margaret Eker <meker@adobe.com>
@NadiyaS It looks like the linting test failed because there is a listing error:
|
@NadiyaS Please fix (ask if you have any questions!) and we'll merge. Thanks! |
Still waiting for technical review on this one from @arhiopterecs before it can be merged. Thx. |
src/cloud/howtos/debug.md
Outdated
These variables are removed when the SSH session ends. | ||
If you expect to use SSH and debug multiple times, you can put the export commands into a bash script in the `/tmp` directory to run them each time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it’s enough to indicate that the variables are related to the session.
I propose to remove this:
"If you expect to use SSH and debug multiple times, you can put the export commands into a bash script in the /tmp
directory to run them each time."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
running tests |
Hi @NadiyaS, thank you for your contribution! |
Purpose of this pull request
Update instructions for using Xdebug to debug Magento CLI commands. Add information about specifying the Xdebug configuration file when debugging on Pro Production and Staging environments.
Affected DevDocs pages
whatsnew
Updated Xdebug instructions for debugging CLI commands on Magento Cloud Pro Production and Staging environments to specify the required Xdebug php configuration file (
php.xdebug.ini
) when debugging commands.