如何用PHP-Eclipse調試PHP程式____PHP

來源:互聯網
上載者:User

    筆者剛剛接觸PHP-Eclipse,今天剛把debug PHP的方法弄好,發出來與大家共用一下。

 

    第一步:到Eclipse的官網去下載PHP-Eclipse:http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliossr1

   

   

 

    第二步:下載Xdebug (我用的是php_xdebug-2.1.0-5.2-vc6.dll,下載地址位於:http://xdebug.org/download.php),並且放入到"PHP5/ext"中

 

    第三步:在PHP5裡面找到php.ini,在這個檔案的最後面加入如下配置資訊:

[Xdebug] zend_extension_ts="C:/Program Files/phpStudy/PHP5/ext/php_xdebug.dll" xdebug.auto_trace = On xdebug.show_exception_trace = On xdebug.remote_autostart = On xdebug.remote_enable = On xdebug.remote_host = 127.0.0.1 xdebug.remote_port = 9000 xdebug.remote_handler = dbgp xdebug.profiler_enable = on xdebug.profiler_output_dir="C:/Program Files/phpStudy/PHP5/log"

    這裡要特別注意:如果在檔案裡有其他的zend_extension_ts,需要注釋掉,否則apache無法啟動。

 

    第四步:啟動apache。

 

    第五步:在eclipse的項目裡的Properties裡面找到"PHP Debug",在PHP Debugger裡面選擇"XDebug"

 

   

 

    再配置一下:

 

   

 

   

   

    第六步:再在Windows->Preferences裡面配置下PHP Servers

 

   

 

   

 

     接下來,進入debug介面,就可以開始設定斷點進行debug了。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.