❝
The development process will inevitably encounter unknown errors, specified not a bit of debugging bar! This article takes you through debugging programs using Atom. If you have any questions, please reply in the comments section.
❞
Install PHP-debug in Atom
Click file – > SettingsThen click install and search for PHP-debug. If the search fails, you need to do something about it. Learn to surf the Internet correctly!This is what a successful installation looks like
Download Xdebug
Download address:https://xdebug.org/download
When you open the address, you can see the extension, which is installed in PHP7.3But there are two PHP7.3 options for that! Open your PHP environment and see vC15 in the boxThen put the downloaded file inD: \ phpstudy_pro \ Extensions \ PHP \ php7.3.4 NTS \ ext
Here is the address of Kakaka. Just put it in your own PHP environment.
Three, configuration,
Then go to your php.ini file and copy the following configuration into it. Remember to change the location of zend_extension.
This location depends on your PHP location.
[Xdebug]
zend_extension = D:\phpstudy_pro\Extensions\php\php73.4.nts\ext\php_xdebug2.96.7.3-vc15-nts-x86_64.dll
xdebug.remote_enable = On
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp xdebug.idekey=xdebug-atom Copy the code
How to determine this position! If you’re using a newer versionphpstudy
.D: \ phpstudy_pro \ Extensions \ PHP \ php7.3.4 NTS \ ext
That’s this position right thereIf you are an older version of PHPStudy the location is inC: \ phpStudy - 7.1.13 - NTS \ PHPTutorial \ PHP \ PHP \ ext
Four, test,
Remember to reboot your environment once you’re done.
Two things need to happen at this point.
First, open Atom debug
The second address in the address bar to lose on http://localhost/index.php? XDEBUG_SESSION_START=1 note the latter argument here.
A pop-up box will appear, and fill in the address as your project pathAt this point the debug panel comes out and you can see that our variable values have been printed out.At this point our breakpoint debugging is complete.
Five, the summary
Summary of important steps to configure breakpoints.
- Atom – download PHP debug
- Download Xdebug and put it in the appropriate PHP extension
- Address bar access needs to carry
? XDEBUG_SESSION_START=1
- Do not configure the atom path using a skew bar