![]() 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 |