Enrique Tang
asked on
Debugging PHP MVC framework
Hi,
I just taken over a PHP project but the codes are in MVC. I have a middle level PHP skill.
Any suggestion to debug the codes for MVC ?
I tried the debug_print_backtrace , print_r and var_dump but it doesn't seems helping to trace which files related to which files.
I just taken over a PHP project but the codes are in MVC. I have a middle level PHP skill.
Any suggestion to debug the codes for MVC ?
I tried the debug_print_backtrace , print_r and var_dump but it doesn't seems helping to trace which files related to which files.
do you know exactly which framework is used? so it will be easy to use the framework debug methods. What are you trying to debug exactly? Please provide more details.
If you can get a copy of the code base installed on a local/development environment, then you can make use of Xdebug in conjunction with a decent IDE (Atom, VSCode, PHPStorm) to add breakpoints within your code to perform some debugging.
Alternatively, if you simply want to dump output then most modern frameworks provide some sort of error logging facilities out of the box (Laravel Error Logging). Review the documentation for your framework to see what, if anything, is already available to you.
Alternatively, if you simply want to dump output then most modern frameworks provide some sort of error logging facilities out of the box (Laravel Error Logging). Review the documentation for your framework to see what, if anything, is already available to you.
ASKER
Thanks for the reply Vel, I done some googling for the XDebug, but the documentation is bit deep for me.
Does it require server knowledge ?
Do you have any good link to XDebug for beginner ?
Does it require server knowledge ?
Do you have any good link to XDebug for beginner ?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.