Salve a tutti.
Sto cercando di configurare la triade XAMPP+EclipsePDT+Zend debugger
Non riesco a far funzionare nulla !!
Andiamo per ordine.
Uso Windows Xp, Drupal 6.15
1) Ho scaricato ed installato la versione 1.7.3 di XAMPP che contiene
* Apache 2.2.14
* MySQL 5.1.41
* PHP 5.3.1
* xdebug
Tutto Ok
2) Ho scaricato la versione Eclipse PDT "All-in-one" file pdt-2.1.0-win32-x86.zip
dal sito http://www.zend.com/it/community/pdt
Installata (basta copiare più o meno) e parte. Ok
3) Ho tentato di configurare il debug impostandolo a Zend debugger, ma non riesco a far partire un bel nulla.
Domanda:
Qualcuno già ci si è scontrato?
Se qualcuno usa Eclipse PDT con Zend Debugger+PHP+Apache mi può dire che versioni ha?
E quale PHP usa nella configurazione? Quello incluso in EclipsePDT o quello di XAMPP (esterno)?
Naturalmente ho provato ad impostare come debug Xdebug, configurando il file php.ini in questo modo:
[XDebug]
;Only Zend OR (!) XDebug
zend_extension=C:\programmi\xampp\php\ext\php_xdebug-2.0.5-5.3-vc6.dll
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir=C:\Programmi\xampp\tmp
Il debug parte, ma purtroppo dopo poco casca apache!!
Grazie
Io sono riuscito con PHPEclipse e xdebug (e basta). Funziona bene. Ma sono un pò diluso di PHPEclipse, e voglio provare Eclipse + PDT. Ci sarà Mavimo che stringe i denti - avevo promesso di provare Netbeans!
Ho seguito questi esempi:
http://php.html.it/articoli/leggi/2540/debug-grafico-con-xdebug-ed-eclip...
http://www.drupalitalia.org/node/5770
http://programmingbulls.com/debugging-drupal-php--xdebug-eclipse
Comunque, sistemare Eclipse per bene non è proprio facile, i miei notes (per ogni maledetto sito!):
/php-eclipse
The PHP developers version of Eclipse (Version 3.5.1)
Installation:
Set the workspace to /home/john/syger/work/tools/php-workspace
Additional Configuration:
1. Go to :
window > preferences > validation
and disable the PHPTaskValidator validation.
2. Go to:
window > preferences > PHP > debug
Select
- PHP Debugger: Xdebug
3. Go to:
window > preferences > PHP > debug
Select
- Server: Click on PHP Servers
* For every website you have in Eclipse, make a PHP Server *
Fill in these 2 fields:
- Name: 'Your Project Name'
- URL: Your subdomain or url where the project can be accessed (ex.: http://localhost.drupal6 )
4. Go to:
window > preferences > PHP > PHP Executables
- Name: 'PHP with Xdebug'
- Executable Path: '/usr/bin/php5'
you can find your path with 'which php5'
- php.ini: '/etc/php5/apache2/php.ini'
- PHP Debugger: XDebug
5. Go to:
window > preferences > PHP > Debug > Workbench Options
- Allow multiple debug sessions: 'Never'
6. Make sure you loaded your project in Eclipse (doesn't matter if you have more directories beneath it)
Go to:
run > Debug Configurations > PHP Web Page
- Click right on 'PHP Web Page' and click 'New'
- Select your new PHP Server (remember step 3? 'Your Project Name')
- Click Browse and select your Drupal Project index.php
- Check off Auto Generate
Go to:
run > Debug Configurations > PHP Web Page > Advanced
- Check: 'Open in Browser'
- Start Debug From: "http://yoururl/index.php"
7. Test the configuration
Add some breakpoints to the code, for example to check if this works, add a breakpoint in index.php.
Go to:
run > Debug Configurations > Your Project
- Click Debug and have fun debugging!
8. See http://drupal.org/node/75242 for further editor configurations
Ho modificato entrambi i file php.ini (cioè CLI /etc/php5/cli/php.ini e Apache /etc/php5/apache2/php.ini) aggiungendo:
[Xdebug]
#extension=/usr/lib/php5/20060613/xdebug.so
zend_extension=/usr/lib/php5/20060613/xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
; profiler settings
;xdebug.profiler_append=0
xdebug.profiler_append=1
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_name=cachegrind.out.%s
xdebug.profiler_output_dir=/home/john/syger/work/tools/xdebug
Più imparo, più dubito.
@jhl.verona: vabbè, se sei masochista non posso farci nulla :D
PS: la configurazione di john va bene su sistemi linux, per sistemi windows ci sono da cambiare i path indicati.
Ciao
Marco
--
My blog
Working at @agavee
Potresti utilizzare ZendServer & Zend studio che sono automaticamente configurati per il debug in php spendi qualche soldo nella licenza dello zend studio ma non stai a perdere tempo in configurazione.
Io li utilizzo su mac sono sicuro ci sia la versione per vindows per linux non so
Ciao Marco
Sintetika s.r.l.
Communication Technology Innovation
www.sintetika.it