![]() If you do not specify Server, the program will accept all connections: You can leave default values in the settings and change only the debugger configuration name. Press the plus button and select PHP Remote Debug in the list. You should configure the debugger in this window. Run the program, then open menu Run -> Edit -> Configurations. Restart Apache when the settings have been saved using this command: sudo systemctl restart apache2 PhpStorm uses port 9000 by default at this moment. Next, in lines xdebug.client_host and xdebug.client_port specify the host program that will manage debugging. In this configuration the host has been specified in the next line, so this feature is not required. If the third line xdebug.discover_client_host value is true, Xdebug will be trying to connect to the host specified in the HTTP_X_FORWARDED_FOR header. Use this option when you don’t want the debugger to run unnecessarily. trigger – run debugger when the special variable is set in $_ENV, $_POST or $_COOKIE array.no – run debugging only from code, using specific methods.yes – always, when any PHP script starts.Second line xdebug.start_with_request determines how to run a debugger for debug and trace modes. trace – enables only tracing of the program execution.debug – enables step-by-step code execution, use it in this case.develop – enables output additional information in var_dump and exceptions output.The first parameter xdebug.mode configures debugging mode and can contain one of the following values: Here is a detailed explanation for these settings. In this case use this configuration lines: sudo vi /etc/php/8.0/apache2/conf.d/20-xdebug.ini xdebug.mode=debug ![]() The older versions of the extension does not support these versions of PHP. If you use PHP 8.0 or higher, you should use new Xdebug 3. If you want to use the old version of Xdebug, add these lines to the /etc/php/7.4/apache2/conf.d/20-xdebug.ini file: sudo vi /etc/php/7.4/apache2/conf.d/20-xdebug.ini zend_extension=xdebug.so Xdebug should try to connect to PHPStorm when the debugging session has started. When Xdebug installation process finishes you should configure it for working with PHPStorm. Run the following command to do this: sudo apt install php-xdebug It will help you enable debugging mode in your browser.įirst of all, install Xdebug. Therefore you should have the Debug Helper browser extension. ![]() Very often, developers use a browser or command line to run their programs. But IDE can’t tell the debugger when it should start debugging, because IDE is only responsible for the code. So, you can use your IDE to start and handle debugging. But it’s management interface is not user-friendly. ![]() Xdebug debugger can suspend code execution, look at call stack and values of variables. For other configurations, file paths can be different but the essence remains the same. We will explain how to configure all things using Ubuntu operating system and PHP interpreter configured for Apache. If you want to install PHPStorm see this article. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |