I chose Homestead over Docker containers mainly because Homestead comes pre-baked with all the dependencies I need, and it was easy to set up. In order to support another developer I switched the project over to Homestead. The project im testing this with I started development on my Linux machine about a year ago. ![]() I want to be able to develop on Linux, Mac, or Windows, so I’ll need a workflow that works for all of those. Recently Jetbrains announced similar functionality. You’ve been able to do this for some time using VSCode, via it’s Remote Development feature. You might be thinking, “just use docker” right? That’s part of the solution, but the missing piece for a while has been a way to run the development environment directly along-side the application so that you can have a seamless experience when debugging. Switch to http: //homestead.It’s the end of 2021, and we can finally port our development environments. You can see the Debug flag in the upper right corner after installation. Take Chrome as an example to expand the program page, search XDebug Helper. Need to change the directory: At this location, PHPSTORM is connected to the Homestead virtual machine. xdebug.client_port=9005 Finally, check it to see if PHPSTORM can successfully link the virtual machine: There is a small pit, the latest version of laravel, put index.php in the public directory, so the validate will be wrong. Next, set the PHP CLI via FILE-> Setting Choose a new Vagrant's CLI, set the Instance Folder to our Homestead project, you can see the following display after success: Return the Setting interface, point the Debug sub-option The purpose of the 9005 is changed here because it is set in xdebug.ini. On the right, fill in the code path on the virtual machine. Homestead.test is the URL of the virtual machine Webserve Server HTTP requests the default 100 port Another most important is to fill in the code map of the local code and the Webserver. Add a Servers project: Host: Port refers to which page we commissioned. The most important thing is the IDE Key, this and the XDebug.ini set xdebug.idekey=PHPSTORMCorresponding. Third, configure PHPSTORM Configure Debug ConfigureĬlick here to enter the configuration interface Click on the left plus, add a PHP Remote Debug project, then fill in the following options. Still use the previous phpinfo () page to test If these two values are right, the xdebug module has been successfully launched. Xdebug.client_port =9005 # h, the default is 9000/9003Īfter the modification is complete, you need to restart the PHP-FPM to use the new configuration. It turns out to delete: #zend_extension=xdebug.so #xdebug.remote_enable = 1 #xdebug.remote_connect_back = 1 #xdebug.remote_port = 9000 #xdebug.max_nesting_level = 512 ![]() Note that the new version of PHP uses Xdebug3, so there are some differences in the configuration of the grammar. You can also confirm in the configuration file, take PHP 8.0 as an example: vi /etc/php/8.0/mods-available/xdebug.ini Homestead defaults to open the PHP XDebug module. Virtualbox 6.0 PHPSTORM 2020.3.3 (old version cannot be adapted to XDebug3) Second, configure XDebug Open XDebug First, XDebug parameter setting Debugging environment $ vagrant ssh ![]() Special settings are also required when debugging virtual machine remote codes using PHPSTORM. The parameters of XDebug3 have changed, so even if the local code is commissioned, it is necessary to make certain modifications in php.ini.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |