Xdebug 3 phpstorm3/30/2023 You could do this yourself manually, but who has time for manual processes? Set up PHPStorm for debuggingĪt this point, it’s a good idea to validate the Xdebug configuration within PHPStorm. Essentially all these extensions do is allow you to set a special GET/POST or COOKIE parameter needed to trigger debugging from a browser request. The PHPStorm help docs have a list of all the different popular browsers, and the extension(s) needed for each. Install one of the Xdebug Browser debugging extensions for your browser With Xdebug v3.0.1, Copyright (c) 2002-2020, by Derick Rethans Zend Engine v3.3.25, Copyright (c) 1998-2018 Zend Technologies You should see something like this, which confirms Xdebug is enabled with PHP. Then, restart your web server, and check that Xdebug has been enabled. You also need to enable Xdebug debugging, which depending on your Xdebug version, requires a slightly different php.ini line. Inside it you’ll find the xdebug.so file, which you need to configure by adding it to your php.ini. This is usually in your /usr/lib/php/ directory, in a directory named after a date (eg 20190902). First, check where the xdebug.so (“Shared Object”) file is located. Once Xdebug is installed, you need to tell PHP to use it, which requires some additions to your php.ini. It’s recommended to use the latest version available version of Xdebug, but I suggest first getting used to it by using the version available in the Ubuntu repositories, before attempting a manual install to make sure you’re always on the latest and greatest. For example on my old 20.04 LTS workstation, the Xdebug version is 2.9.3 for some reason, while on my 20.04 LTS laptop it’s 3.0.1, and the latest version is 3.0.2. Depending on your Ubuntu version, the version of Xdebug in the repository might be out of date. The instructions also include how to install a specific version of Xdebug if you’re using a different version of PHP than what is available on your version of Ubuntu’s repositories, like if you’re using Ondřej Surý’s PPA.Ī note on versions. On Ubuntu, since 18.04, it’s as straightforward as running the following command. The Xdebug installation docs include a detailed list of install commands for a wide range of Linux operating systems. It is possible to use this set up if you are using some form of virtualisation, but that’s a topic for another post. This article covers using either Apache or Nginx installed directly on your Ubuntu machine with PHP, and not running inside any virtual environment. It might not be as completely integrated into your PHPStorm environment as a fully configured set up, but it quickly gets you into the world of debugging PHP line by line.Ī note on local environments. Install a few tools, turn a few things on, hit refresh in your browser, and you’re step debugging your PHP code. The PHPStorm Zero-configuration debugging process requires almost zero configuration. It really is the quickest way to get up and running debugging your code inside PHPStorm with Xdebug. I think that doc might even be the reason I’ve never blogged about it. To be honest, if you can read the Zero-configuration debugging help doc from PHPStorm, you probably don’t need this article. I’ve been using Xdebug on Ubuntu in PHPStorm for going on 4 years now, and as I’ve been actively blogging about my development set up, I thought for sure I’d written about this. Has anyone done a simple writeup of setting up Xdebug with PHPStorm on Ubuntu?Īlso, if you've done a writeup or read one you like on *any* OS, would you mind letting me know so we can get it added to - Matt Stauffer January 21, 2021
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |