![]() Xdebug CLIĪll applications are not web-based. Jump to chapter "Run Xdebug" to see how to use Xdebug. Indeed, from the point of view of Xdebug, the PHP application runs in the "/var/this point, you should be able to put a breakpoint in your code, start a debugging session and get the application to stop on the breakpoint. (8) Don't forget to click on Use path mappings (7) Add your host on port 80 using Xdebug (5) Once it's done, you are on debug server page. (2) Confirm it by clicking on PHP Web Page Registering your container server in PHPStormįirst, click on edit configurations, on the top right of PHPStorm window. Otherwise, just keep the default configuration port. If you want to use another port for Xdebug, follow the instructions below. This directly conflicts with the XDebug port. In particular, if you are using PHP-FPM, the default port for PHP-FPM is 9000. except if port 9000 is already taken by another program on your host (your machine running PHPStorm). Out of the box, everything should be fine. Our PHP container has Xdebug installed and Xdebug will try to connect to PHPStorm on port 9000 by default. Keep in mind that PHPStorm opens port 9000 (by default) so Xdebug can connect to it. It automatically configures Xdebug for the container. Note: the PHP_EXTENSION_XDEBUG environment variable is specific to the thecodingmachine/php. Image: thecodingmachine/php:7.2-v1-apache My base docker-compose.yml file looks like this: app: If you are starting a project, I recommend you to download one of our images here TheCodingMachine Docker PHP images In my example, I will use a Docker image of TheCodingMachine created by David Négrier. In the Troubleshooting guide, you will find the description of some common issues and learn how to troubleshoot them.To follow this tutorial, you must have the Xdebug extension installed on your container. When using Xdebug or Zend Debugger with PhpStorm, some misconfiguration can prevent the debugger from working. For more information, refer to Debug failed tests. Set up a remote PHP interpreter as described in Configure remote PHP interpreters.īesides running an entire application, you may want to run a PHPUnit or Behat test that covers a specific class, function or scenario, with the debugging engine attached. Debugging a PHP CLI scriptĭepending on your environment, you can debug your PHP CLI script locally or remotely.įollow the Debug a PHP CLI script procedure. To check for opened inbound ports, you can use or a similar service. Here, host is the IP address of the local machine PhpStorm is running on. To test direct connection, run the telnet host 9000 (for Xdebug) or the telnet host 10137 (for Zend Debugger) command on the remote server and ensure that connection is established. Otherwise, if direct connection cannot be established, follow the Remote debugging via SSH tunnel procedure. If you can establish direct connection between your machine and the remote server, that is, no firewall, router or ISP is blocking the connection from your remote server to the specific port on the local machine, follow the Zero-configuration debugging procedure. The debugging engine is running on a remote environment (for example, a remote server or a virtual machine).įollow the Zero-configuration debugging procedure. The debugging engine and PhpStorm are running on the same machine. Debugging a PHP web applicationĭepending on your environment, you can debug your PHP Web application locally or remotely. See Zero-configuration debugging for the detailed step-by-step instructions, and Advanced debugging scenarios for more debugging scenarios. ![]() Start the debugging session in the browser using the installed browser extension.ĭuring a debugging session, examine the program state: see variable values, evaluate expressions, step through the program, and so on. For more information about getting started with Twig and Blade debugging, refer to Debug Twig templates and Debug Blade templates. Line breakpoints can be set only on executable lines, but not on comments, declarations, or empty lines. Breakpoints can be set in the PHP context inside PHP, HTML, TWIG, BLADE, and files of other types. On the PhpStorm toolbar, toggle ( in the classic UI) to start listening for incoming PHP debug connections, or choose Run | Start Listening for PHP Debug Connections from the main menu. With the debugging engine installed, you can start debugging by following the zero-configuration debugging approach:Ĭhoose and install the browser extension suitable for your browser.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |