P
P
Petr Volkhanov2014-02-17 22:58:28
PHP
Petr Volkhanov, 2014-02-17 22:58:28

How to debug PHP scripts?

Please share your experience and advice on how you debug PHP scripts. Can you suggest good articles in Russian, as well as videos. I know about xDebug, but most likely this option will not work, since you need to debug in production.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
O
OnYourLips, 2014-02-17
@OnYourLips

xdebug works fine in production, but debugging in production is inexcusably stupid.

R
Rowdy Ro, 2014-02-17
@rowdyro

Doing debugging in production is evil.
Cover the code with autotests, load and use xdebug.
Because another option is logging. But here it does not work on load, even if you are a master of regular expressions.

A
Alexey Blyshko, 2014-02-18
@nekt

If there is a server for testing, you can start by logging all requests for production and feeding them to the test server already with a hedbug in manual or automatic mode - depending on skills and preferences. The test server can be set up exactly like a production server - fortunately there are only three components that cover 99% of the repeatability of error results. This is the environment, code and data.
In general, full profiling raises the load by only an order of magnitude. Maybe there will be enough production for this task, if it is a one-time task and it is urgent. But yes. Not kosher and generally bad practice.

V
Vitaly Zheltyakov, 2014-02-18
@VitaZheltyakov

Of course xDebug. It is enough to turn on tracing for a while and get data about the execution of scripts in the problem area. Tracing will provide more data than all other tests combined.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question