Guide 22 - Debugging PHP code, line by line |
7/18/2021 7:18:23 PM |
PHPRunner Tips and Tricks | |
![]()
In the end I have decided that you will be those who must say if you are interested in this topic or better not get into many trouble. I use it and with him I learn a lot, because it allows me to run PHP programs, be able to stop the execution at a point and go, line by running the code section that interests me to review because it does not do what I understand should do. In summary, it is a programming and validation environment of PHP code. Objective Have a development environment where I can debug PHP code and be able to observe, line a line the evolution and content of the variables of the application. Proposed technical solution. First of all, if your work is to develop code, you must install and work with Microsoft Visual Studio Code (it's free). It is excellent for working with PHP but for me it seems to me that to begin with it is much simpler to start and understand the NetBeans development platform, now Apache and that is also free. So this is what I am going to explain and depending on acceptance, we will see if at another time I decide to tell you how to use the Microsoft platform. First of all, indicate that what I am going to explain is to install on a computer with the following characteristics:
It is worth any XAMP or other distribution version. All detail and video of use on my portal |
|
![]() |
fhumanes author 7/18/2021 |
To begin, you have to download and install the following software:
In my case, I have the PHP installation on "C:\PHP", so the XDEBUG DLL has saved it in "C:\PHP\EXT". Now we have to indicate the PHP that activates the debug and we do this including these lines at the end of the file "php.ini" that I have it in "c:\php\php.ini". ; NETBEANS To make it work you have to stop Apache and restart it again. With this we already have everything we had to install and now we only have to try it. There are many videos on YouTube where to explain how to use NetBeans to debug and I propose to see:
Continue reading in my portal |
C
|
ckranichDevClub member 7/21/2021 |
Dear F Humanes, Many thanks for your posts! I am very keen trying this out. Until now I used the "poor man's debug methods" Kind greetings, ckranich |
D
|
DRCR Dev 9/10/2021 |
I too have used the poor man debug for too long. Thank you. This will make a big difference in my work. I often spend 2 days trying to fix 1 line of code. |
B
|
BobAlstonNEW 10/8/2021 |
I have viewed your video and tried to install and use Netbeans as you suggested. I think I got the netbeans configuration right. I can see the project in the left side of Netbeans. But so far I can't get it to do anything useful. Thanks |
![]() |
fhumanes author 10/8/2021 |
Hello there: Have you tried to follow the videos that there is and the Internet about PHP debugging in NetBeans? The most important thing is to verify that if it indicates "Debug" the project at the end of the screen indicates that the product is prepared. If you continue to give you problems (after watching the videos on YouTube) write me to my email fernandohumanes@gmail.com
Greetings, fernando |