Diferencia entre revisiones de «PHP IDE Netbeans»
Ir a la navegación
Ir a la búsqueda
| Línea 11: | Línea 11: | ||
== Activando o modo Debugger == | == Activando o modo Debugger == | ||
| + | |||
| + | |||
| + | === Instalado XDEBUG EXTENSION FOR PHP === | ||
* Primeiro debemos ter instalado [https://xdebug.org/ XDEBUG EXTENSION FOR PHP]. | * Primeiro debemos ter instalado [https://xdebug.org/ XDEBUG EXTENSION FOR PHP]. | ||
| + | |||
| + | * Instalaremos o paquete '''php-pear'''. | ||
| + | |||
| + | ::<syntaxhighlight lang="java" line enclose="div" highlight="" > | ||
| + | pt-get install php-pear | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | |||
| + | * Despois instalamos o módulo xdebug necesario para facer o debugger | ||
| + | ::<syntaxhighlight lang="java" line enclose="div" highlight="" > | ||
| + | pecl install xdebug | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | |||
| + | * Ao rematar a instalación podemos ver onde gardou a librería compilada. | ||
| + | |||
| + | [[Imagen:Php_install_xdebug_2.JPG|400px|center]] | ||
| + | |||
| + | * Podemos deixala onde está ou copiala ao cartafol /usr/lib | ||
| + | |||
| + | |||
| + | === Activando o modo debugger en NetBeans === | ||
| + | |||
| + | * Unha vez instalado, teremos a librería no cartafol: '''/usr/lib/php5/20121212/xdebug.so''' | ||
* Se queremos facer un debugger da aplicación en PHP é necesario engadir unha serie de parámetro no arquivo '''php.ini'''. | * Se queremos facer un debugger da aplicación en PHP é necesario engadir unha serie de parámetro no arquivo '''php.ini'''. | ||
| Línea 19: | Línea 46: | ||
* Podemos ver que liñas engadir neste enlace: http://wiki.netbeans.org/HowToConfigureXDebug#How_to_on_Linux | * Podemos ver que liñas engadir neste enlace: http://wiki.netbeans.org/HowToConfigureXDebug#How_to_on_Linux | ||
| + | * Debemos engadir estas liñas ao arquivo php.ini do apache: | ||
| + | |||
| + | ::<syntaxhighlight lang="java" line enclose="div" highlight="" > | ||
| + | zend_extension=/usr/lib/php5/20121212/xdebug.so | ||
| + | xdebug.remote_enable=1 | ||
| + | xdebug.remote_handler=dbgp | ||
| + | xdebug.remote_mode=req | ||
| + | xdebug.remote_host=127.0.0.1 | ||
| + | xdebug.remote_port=9000 | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | |||
| + | : <u>Nota:</u> É importante poñer a ruta completa onde se atopa a librería xdebug. | ||
| + | |||
| + | * Finalmente debemos reinicar o servizo apache: | ||
| + | |||
| + | |||
| + | ::<syntaxhighlight lang="java" line enclose="div" highlight="" > | ||
| + | service apache2 restart | ||
| + | </syntaxhighlight> | ||
Revisión del 19:56 17 sep 2016
Sumario
Introdución
- Non é obrigatorio utilizalo pudendo usar calquera editor de texto dispoñible.
Instalación
Activando o modo Debugger
Instalado XDEBUG EXTENSION FOR PHP
- Primeiro debemos ter instalado XDEBUG EXTENSION FOR PHP.
- Instalaremos o paquete php-pear.
1 pt-get install php-pear
- Despois instalamos o módulo xdebug necesario para facer o debugger
1 pecl install xdebug
- Ao rematar a instalación podemos ver onde gardou a librería compilada.
- Podemos deixala onde está ou copiala ao cartafol /usr/lib
Activando o modo debugger en NetBeans
- Unha vez instalado, teremos a librería no cartafol: /usr/lib/php5/20121212/xdebug.so
- Se queremos facer un debugger da aplicación en PHP é necesario engadir unha serie de parámetro no arquivo php.ini.
- Podemos ver un vídeo explicativo neste enlace: https://www.youtube.com/watch?v=k4ByadtSra8
- Podemos ver que liñas engadir neste enlace: http://wiki.netbeans.org/HowToConfigureXDebug#How_to_on_Linux
- Debemos engadir estas liñas ao arquivo php.ini do apache:
1 zend_extension=/usr/lib/php5/20121212/xdebug.so 2 xdebug.remote_enable=1 3 xdebug.remote_handler=dbgp 4 xdebug.remote_mode=req 5 xdebug.remote_host=127.0.0.1 6 xdebug.remote_port=9000
- Nota: É importante poñer a ruta completa onde se atopa a librería xdebug.
- Finalmente debemos reinicar o servizo apache:
1 service apache2 restart
-- Ángel D. Fernández González -- (2016).