As of Xdebug 3, it is possible to disable the Xdebug completely by setting the option xdebug. mode to off , or by setting the environment variable XDEBUG_MODE=off . It is very easy to disable Xdebug just for composer, by aliasing composer . You can add the alias to your $HOME/.
UPDATE -- Disable for CLI only d/20-xdebug. ini is just a symlink and if you edit it, you edit the original file which is common for cli and non-cli. I think the right solution is simple delete the symlink.
Xdebug allows you to break during code execution and inspect all the variables in scope during a request. What this means is you have everything you need to troubleshoot during only one iteration of this cycle.
Find your php.ini
and look for XDebug.
Set xdebug autostart to false
xdebug.remote_autostart=0
xdebug.remote_enable=0
Disable your profiler
xdebug.profiler_enable=0
Note that there can be a performance loss even with xdebug disabled but loaded. To disable loading of the extension itself, you need to comment it in your php.ini. Find an entry looking like this:
zend_extension = "/path/to/php_xdebug.dll"
and put a ;
to comment it, e.g. ;zend_extension = …
.
Check out this post XDebug, how to disable remote debugging for single .php file?
An easy solution working on Linux distributions similar to Ubuntu
sudo php5dismod xdebug
sudo service apache2 restart
In Linux Ubuntu(maybe also another - it's not tested) distribution with PHP 5 on board, you can use:
sudo php5dismod xdebug
And with PHP 7
sudo phpdismod xdebug
And after that, please restart the server:
sudo service apache2 restart
Also, you can add xdebug_disable()
to your code. Try:
if(function_exists('xdebug_disable')) { xdebug_disable(); }
I renamed the config file and restarted server:
$ mv /etc/php/7.0/fpm/conf.d/20-xdebug.ini /etc/php/7.0/fpm/conf.d/20-xdebug.ini.bak
$ sudo service php7.0-fpm restart && sudo service nginx restart
It did work for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With