¿Es posible usar xdebug en Ubuntu?


Estoy tratando de depurar algún código PHP y quería descargar el depurador XDebug para PHP. Todo lo que veo son binarios de Windows para descargar. ¿Es posible usarlo en Ubuntu?

Author: Undo, 2011-03-31

7 answers

Ejecute los siguientes comandos en su terminal.

Descargar Xdebug - tendrá que seguir instrucciones alternativas si no tiene PHP5 trabajando en su máquina ya.

sudo apt-get install php5-xdebug

El paquete debería modificar su archivo INI por usted, pero en caso de que necesite editarlo usted mismo, ábralo y haga la siguiente modificación - en Ubuntu normalmente está en /etc/php5/apache2/php.ini-añade la siguiente línea.

zend_extension="/usr/lib/php5/20110331/xdebug.so"

Ese camino podría ser un poco diferente en su sistema - solo asegúrese de que su un camino totalmente cualificado a la xdebug.so archivo en su máquina. También recuerde comentar cualquier referencia al depurador de Zend - no puede ejecutar ambos al mismo tiempo.

Ahora reinicie Apache.

sudo /etc/init.d/apache2 restart

Es posible que también necesite habilitar html_errors. Buscar html_errors en / etc/php5/apache2 / php.ini y asegúrese de que esté activado. También es necesario reiniciar Apache.

html_errors = On

Verifique con phpinfo() para asegurarse de que todo está instalado correctamente-es posible que también desee establecer configuraciones para Xdebug en su php.archivo ini.

 107
Author: Jarrod Nettles,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-08-15 10:02:13
sudo apt-get install php5-xdebug
 20
Author: Parris Varney,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-10-16 03:58:25

En un Ubuntu más nuevo (al menos en 14.04 LTS), necesitaba activar el módulo también. Así que, en total lo hice:

sudo apt-get install php5-xdebug
sudo php5enmod xdebug

Después de reiniciar el servidor, xdebug estaba disponible.

 13
Author: kronn,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-08-30 12:14:14

Este artículo fue lo que me ayudó en Ubuntu 16.04 ejecutando PHP7:
Enlace al artículo

sudo apt-get install php-xdebug
 9
Author: CIRCLE,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-11-22 18:12:26

:: ubuntu 18.04, php7. 2, apache2:: 1. Primero instale xdebug usando sudo apt-get install php-xdebug. 2. Esto creará el archivo/etc/php/7.2 / mods-available / xdebug.ini 3. Puede ejecutar sudo phpenmod xdebug 4. abre xdebug.ini usando sudo nano /etc/php/7.2/mods-available/xdebug.ini 5. solo se puede ver la línea: zend_extension=xdebug.so 6. asumiendo que se ejecuta php apache en localhost y netbeans IDE, agregue la siguiente línea a xdebug.ini

xdebug.show_error_trace = 1
xdebug.idekey=netbeans-xdebug
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1

N.b.: xdebug.idekey y xdebug.remote_port se puede obtener desde netbeans tools - >optins- > php - >debug

 0
Author: priyaranjan misra,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-21 03:04:27

Forma correcta de instalar XDEBUG para la versión más reciente de LAMPP:

  1. Descargar: XDEBUG última versión llamado fuente.

  2. Extraer el archivo a cualquier carpeta.

  3. Abra esta carpeta con terminal.

  4. El Cambio X. X. X a Tu realidad la versión de php

  5. Ejecute los siguientes comandos en su terminal.

    /opt/lampp/bin/phpize-X.X.X
    ./configure --with-php-config=/opt/lampp/bin/php-config-X.X.X
    make
    cp modules/xdebug.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20170718
    

Ahora necesitamos editar archivo php.ini

  1. Abra la carpeta donde está el archivo php.ini en la terminal:

    sudo nano ./php.ini
    
  2. Agregue al final del archivo esto:

    zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
    
  3. Abrir la carpeta LAMPP en la terminal

  4. Ahora reinicie Apache.

    sudo ./xampp restart
    

Y ahora puede comprobar phpinfo() para ver XDEBUG está instalado.

 0
Author: MESSIAH,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-09-30 22:56:39

Intenta compilar desde el código fuente, eso es lo que hago en mi mac.

De lo contrario, esto podría ayudarte: http://ubuntuforums.org/showthread.php?t=525257

 -1
Author: bl00dshooter,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-03-31 17:56:30