If you're trying to use access a page of your application and it seems to be stuck "spinning" without the page ever loading, make sure you didn't accidentally leave debugging turned on in PhpStorm. When you're done debugging, don't forget to stop PhpStorm from listening for Debug connections in the Run menu (or click the "Stop Listening." icon). You can also use function keys.step over lines of code with F8, step into a function with F7 and run to the next breakpoint (or to completion if no more breakpoints are defined) with F9. ![]() You can use the icons in the Debug panel to navigate through the code. The Debug panel should now be visible showing the line number where it stopped as well as all the variables that are available for you to inspect. The browser will appear to sit there and "spin" like the page is still loading when debugging is active. When you've done both, it will look like: In PhpStorm, choose your Remote Debug run configuration in the drop down and click the Start Listening for Debug > Connections button. To actually debug, debugging needs to be turned on both in the browser (see link in Resources below) and in PhpStorm. Enter "PHPSTORM" in the Ide key (session id) field.į. * Enter the absolute path to your web root directory in the _Absolute path on the server_ section for the webapp directory.Į. * Select Xdebug in the _Debugger_ drop down. * Enter 443 for the _Port_ since if your site is accessed via HTTPS. Add a new server by clicking the green '+' icon. Choose a server by clicking the '.' button beside the Servers field.ĭ. Add a name like "Remote Debug" in the Name field.Ĭ. Click the green '+' icon and choose PHP Remote Debug from the drop down.ī. In PhpStorm, choose Run | Edit Configurations.Ī.Inside the nginx directory, create a new file called default.Sudo /etc/init.d/httpd restart Step-by-step guide Configure PhpStorm Inside it, create two directories: nginx and php. In your project's root directory, create a new directory called docker. Usually, I start with an PHP and a nginx container. You can learn more on Laravel's documentation. Just with this initial setup, you have a solid starting poing for developing an awesome web application. Now that we have a brand new project to work with, let's open it in PhpStorm. Open up a terminal and run: composer create-project laravel/laravel xdebug-test Make sure you have the following things installed on your local: composer, Docker and PhpStorm.įor the purpose of this article, let's create a brand new Laravel application. In this article, I'm going to talk about how to debug your PHP application running in a Docker container while using PhpStorm. Okay, enough talk, let's get to work, shall we? ![]() ![]() It has all the featues you may wish for an IDE and it is built for smoother developer experience. PhpStorm is another great tool that makes our lives easier. If you are curious to know more about it, you can find lots of useful information on their website. If you are a PHP developer, you've probably heard or even worked with Xdebug.įor those of you that haven't heard of this amazing tool: Xdebug is an extension for PHP, and provides a range of features to improve the PHP development experience.Īs you may have guessed it, it's a tool used for debugging.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |