Follow php code

I have a lot of requirements and includes and I was wondering if there is something that can help me look at all PHP code when loading a web page. the reason I am asking is because after flashing with some code I can no longer put any php code as it will not be "felt" by the compiler. for example if i put anything inside php tags

it won't give me an error saying the function doesn't exist. Thanks to someone reading this time.

-2


source to share


4 answers


Not really sure what you are after ...

The get_included_files function can let you see a list of all files loaded by php at that point.

You may also find using grep or "find in files" in your editor (if present) can help you track down something in code that you know cannot be found.

And finally the error - call the following functions at the top of your script to make sure errors are thrown:



error_reporting(E_ALL);
ini_set('display_errors', 1);

      

This still won't catch parsing errors.

Please do not use them on a live system, only in development - it is not good to show error messages to users and they contain information that can help anyone who wants to compromise your system.

So ... not sure about the question, but I answered what I think it might be.

+3


source


You cannot test the PHP code in the browser as it executes the back end and then just displays the output in the browser. You have to manually add the ability to see what the occus is in the code, via echo statements, or perhaps log information.



+2


source


To track and know everything about what your code is doing and how much resources it is consuming, I recommend using a profiler, for PHP I have xDebug Profiler , there are other options like APD and Benchmark Profiler .

xDebug Profiler in action ...

+1


source


You cannot look at PHP code that is not working on your computer. The idea is that the code inside PHP ( <?php ?>

) tags is unloaded, run, and then whatever is outputted, it scrolls back to where the tags were before the final version is sent to your computer. So you don't see the code on your machine.

What you need to do is get an FTP client for an FTP server on the server to see the code.

0


source







All Articles