![]() ![]() Choose your "appserver" CLI Interpreter.In the "Execution" section, choose "Remote interpreter".In the "Local Path" field select your project directory (something like \\wsl$\Ubuntu\home\\dev\my-demo-project).On the "Path mappings" line, click on the folder icon, then: In the "Lifecycle" section, choose "Connect to an existing container". ![]() In the Service dropdown, select appserver.lando folder and locate your project's compose's YAML files (something like \\wsl$\Ubuntu\home\\.lando\compose\mydemoproject) On the "Configuration files" line, click on the folder icon.Select your "Docker for Windows" server.Click on the top-left + button and select "From Docker, Vagrant, VM, WSL, Remote.".button to the right of the CLI Interpreter dropdown To be able to run all tools, PhpStorm needs to know how to execute PHP. Add a "Docker for Windows" item and make sure connection is successful.Go to File | Settings | Build, Execution, Deployment | Docker.Unfortunately I didn't find a solution to do without it and only rely on WSL's Docker. This guides relies on Docker for Windows, using the WSL2 based engine, and setup with WSL integration ( Resources > WSL Integration). uses Composer, and dependencies are installed ( lando composer install).Is "Lando-initialized" ( lando init) and runs ( lando start).lives in a WSL2 instance (something like \\wsl$\Ubuntu\home\\dev\my-demo-project).This guide aims to be the reference for setting up Lando and PhpStorm tools on a WSL2 environment. This entry was posted in PHP Code, Uncategorized. It needs to send a header to the xdebug server and… it doesn’t appear to. However, if you click a link on the browser it will start right back up again. Stopping the DebuggerĬlicking the red square in the debug window all stop the PhpStorm debugger. This is useful for skipping stuff you know you don’t care about. Pressing F8 for Step over will go to the next line but basically never leave the current file: it will not dive down into function calls. Pressing F7 for Step into will make sure to execute every single line of code Now click a link on the application in the browser, and the server will execute all the code up to the red dot, and stop, waiting for a command. Set a breakpoint by clicking in the left margin right next to the code to put a red dot there. Debugging / Stepping through the program executionįirst off, you need to have a breakpoint set, or you will not stop program execution, and so will not have the opportunity to utilize the debugger. Press F9 OR click Run -> Resume Program to finish loading the page. It’s waiting for the IDE to give it the go signal. If you have a breakpoint defined, the browser will appear to ‘hang’ or ‘spin’ or ‘load’ forever. Make sure vagrant is selected in the drop-down next to the green play arrow icon in the header.Ĭlick the green bug icon in the header (hover text is Debug ‘vagrant’ Shift+F9)Ī new browser window will open with a url something like: “” Hovering over it, it will say Start Listen PHP Debug ConnectionsĬlick Run -> Start Listen PHP Debug Connections Start Debugger There’s a telephone icon in the icon bar, with a very small green bug and a red circle with a line through it. Server: 192.168.50.4 should be in the dropdownīrowser: Chrome Start Listening for Debug Connections Under the Run dropdown menu, click Edit Configurations…Ĭlick PHP Web Application, then click the green + Next to the www directory, on the right under Absolute path on the server, enter: /data/www (or wherever your files are stored on the vagrant box) Under File/Directory on the left, Browse to Project Files -> checkoutdirwwwproject-name Under Project Settings on the left, browse to PHP -> ServersĬheck “Use path mappings (select if the server is remote or symlinks are used)” If you’re using SVN, configure PhpStorm to use SVN and check out the project into a new folder. Configuring PHPStorm Create Projectįirst, create a new project. Your IDE (or you, via a url) need to start and stop xdebug. Your IDE needs to know the host IP as well as the path the files reside in on the server. Your IDE needs to listen for connections on port 9000. Xdebug.remote_host=10.0.2.2 IDE-Environments IP, from vagrant box. Xdebug.remote_log="/var/log/xdebug/xdebug.log" ![]() use the following command to find xdebug.so: Needed to add the following to the php.ini to configure it for xdebug: Added to apt-get packages list:Įcho "Creating xdebug log directory: /var/log/xdebug"Įcho "Changing xdebug log directory owner to www-data" Install php5-dev php-pear using apt-get, install xdebug using pecl, creating a properly owned folder in /var/log to store the xdebug log file. ![]() Good instructions here: Updates to the Provisioning Script: To be able to step through code using the IDE of our choice, we need to install Xdebug onto our Vagrant Box. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |