I
I
Ivan Ivanov2020-04-22 13:22:29
PHP
Ivan Ivanov, 2020-04-22 13:22:29

How to disable xdebug in PHP?

When sending an AJAX request, the server returns text with Xdevug styles, so js cannot parse this and an error pops up. How to disable xdebug for a given script?
php:

header('Content-Type: application/json');
return json_encode(1);

js(fragment)
$.ajax({
      url: '/ajax.php',
      method: 'post',
      dataType: 'json',
      data: {type: 'test'},
      success: function(data) {
        console.log(data);
        console.log('OK');
      },

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question