• 5
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 187

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 187
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

How can I use xdebug to debug only one virtual host?

I have installed xdebug, I can see in phpinfo() that it's installed (but it's OFF).

However, I don't want to enable it for the whole server/apache2, I just want to enable it for one virtual host.

How can I do this?

You can set xdebug in php.ini with off value:

zend_extension=/usr/lib/php/modules/xdebug.so
xdebug.remote_enable off
xdebug.remote_port 9000
xdebug.idekey PHP-XDEBUG

and turn on only .htaccess with directive:

php_flag   xdebug.remote_enable on
  • 14
Reply Report
    • The line php_value zend_extension=/usr/lib/php/modules/xdebug.so is incorrect. It should read php_value zend_extension /usr/lib/php/modules/xdebug.so which will not work either. You can not load a PHP extension in a .htaccess file.
      • 2
    • This does not disable xdebug completely, just remote debugging. Is there a way to disable it completely for the hosts where it's not needed? Usecase: the mere presence of xdebug makes it impossible to report errors to NewRelic