Zend Studio Debug

1 09 2011

Zend Studio Debug 的方式  (Debug As…) 有幾種:PHP Script, PHP Web Page, PHPUnit Test。

PHP Web Page

PHP Web Page 的方式可以將整個網站所有的 php 做整體性的測試,也就是可以跨檔案測試。但是要先安裝 Zend Debugger,下載點在這。下載後,解壓縮會看到很多目錄,先確定自己 php 的版本,找尋對應目錄內的 ZendDebugger.dll,拷貝到 php 找得到的地方,我建議放在 ./ext 目錄中,那裡是放所有 php 的 extension 的。

把 Dummy.php 放在網頁的根目錄中。

接下來開啟 php.ini,在最下面加入這幾行:

[Zend]

zend_extension_ts=”C:/AppServ/php5/ext/ZendDebugger.dll”

zend_debugger.allow_hosts=127.0.0.1/32

zend_debugger.expose_remotely=always

再重新啟動 apache 即可。

此時在 Zend Studio 中使用 Debug with PHP Web Page 就可以正常停駐在每一個檔的程式碼開頭以及中斷點。否則若沒安裝好,Debug with PHP Web Page 執行起來就像一般在瀏覽網頁,不會中斷、沒有變數觀測,沒 Debug 的功能。

PHP Script

PHP Script 適用單一 php 的除錯。

PHPUnit Test

PHPUnit Test


管理項目

資訊

發表迴響

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

連結到 %s




Follow

Get every new post delivered to your Inbox.