PHP-5.5.x + Xdebug + Zend Studio 調試環境設定

來源:互聯網
上載者:User

   1、下載安裝xdebug

  1.1 到http://xdebug.org/download.php 下載適合你的PHP版本的xdebug

  1.2 複製到php安裝目錄的ext檔案夾,改名為php_xdebug.dll

  1.3 配置xdebug

  在php.ini尾部添加如下

  [xdebug]

  zend_extension="php_xdebug.dll"

  xdebug.remote_enable = On

  xdebug.remote_host = "localhost"

  xdebug.remote_port = 9000

  xdebug.remote_handler = "dbgp"

  xdebug.auto_trace = 1

  xdebug.collect_includes = 1

  xdebug.collect_params = 1

  xdebug.collect_return = 1

  xdebug.default_enable = 1

  xdebug.collect_assignments = 1

  xdebug.collect_vars = 1

  xdebug.remote_autostart = 1

  xdebug.remote_connect_back = 1

  xdebug.show_local_vars = 1

  xdebug.show_exception_trace = 0

  運行phpinfo();看有xdebug模組資訊出來就是搞定了。

  2、配置Zend Studio 支援xdebug

  這裡的配置很重要

  選擇Zend Studio 的 Window 》 Preference 》 PHP 》Installed Debuggers 雙擊 Xdebug,彈出對話方塊如下圖

  Debug Port 設為跟php.ini中設定的一樣(預設是9000)。

  Accept remote session(JIT) 選擇localhost

  允許瀏覽器訪問網站時zend studio自動開啟檔案開始調試。

  選項說明: http://www.111cn.net

  off: 關閉瀏覽器訪問時開啟調試功能;

  localhost: 通過localhost訪問網頁的時候開啟調試。

  any:只要訪問伺服器上的php都開啟調試;

  prompt:訪問伺服器上的php時彈出詢問是否要調試。

  一旦開啟zend studio允許xebug調試,所有訪問php頁面都會進入調試。

  我們可以使用easy xdebugFirefox外掛程式可在用戶端控制是否開啟調試。

  1、首先php.ini設定

  xdebug.remote_autostart = 0

  不自動啟動調試。

  2、安裝Firefox外掛程式easy xdebug,

  安裝好該外掛程式後,點擊如下圖右下角小綠蟲後,蟲子上面有個小紅點,這時候我們訪問測試伺服器的時候,Zend Studio就回自動彈出調試。

  另外,可設定使用xdebug,在zend studio中對直接調試php文檔,這裡就不多說了。

  Views – 61

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.