小惡魔AppleBOY
AppleBOY
小惡魔 - 電腦技術 - 工作筆記 - AppleBOY is about »
tag cloud
- ajax
- amazon
- amd
- android
- angularjs
- apache
- apc
- api
- appfog
- aws
- backboe event
- backbone.js
- bitbucket
- blog
- boilerplate
- boot
- bootloader
- bower
- browser
- busybox
- c
- c#
- c++
- cakephp
- capistrano
- centos
- chrmoe
- chrome
- ckeditor
- code style
- codeigniter
- coffeescript
- compass
- compass css framework
- conference
- css
- css3
- debian
- denyhost
- django
- driver
- eaccelerator
- editorconfig
- emacs
- embedded system
- error
- excel
- express
- fabric
- fancybox
- fanout
- fanterm
- fastcgi
- fckeditor
- fedora
- firebug
- firefox
- firefox os
- firephp
- flickr
- forefox os
- framework
- freebsd
- friefox
- fuse
- gae
- gaia
- galera
- geany
- gearman
- git
- git hooks
- github
- gmail
- google api
- google app engine
- google extension
- google web toolkit
- grub
- grub2
- grunt
- gruntjs
- haproxy
- html
- html5
- i18n
- icos
- ie
- innodb
- iphone
- javascript
- javascrpt
- jquery
- jquery migrate plugin
- jquery mobile
- jsdc
- json
- kernel
- laravel
- life
- lighttpd
- linode
- linux
- linux kernel
- live.js
- livereload
- mariadb
- memcache
- mobile
- mobile web
- mod_rpaf
- modern.ie
- mount
- mp3
- mssql
- myisam
- mysql
- network
- nexmo
- nginx
- nodejs
- normalize.css
- npm
- nvm
- osdc
- ossf
- pagoda
- pdo
- percona
- performance
- perl
- php
- php-cs-fixer
- php-fig
- php-fpm
- phpbb
- phpbb3
- phpconf
- phpfog
- phpmyadmin
- plurk
- plurk api
- png
- ports
- prgmr
- proftpd
- proxy
- pushstate
- python
- rackspace
- refactor
- requirejs
- responsive design
- rhel
- ruby
- rubygems
- sass
- sencha
- sencha touch
- send-pr
- slicehost
- sms
- spdy
- sphinx
- spinejs
- sql
- squid
- sqwish
- ssh
- sshfs
- svn
- textmagic
- titanium
- titanium mobile
- touch
- twitter bootstrap
- ubuntu
- uderscore.js
- uglifyjs
- underscore.js
- usb
- varnish
- vim
- virtualbox
- vps
- windows
- wordpress
- www
- xcache
- xdebug
- xtrabackup
- yasnippet
- zend framework
- 中正大學
- 剪頭髮
- 好站連結
- 心情日記
- 拉斐爾廚房
- 旅行日記
- 樹太老
- 版本控制
- 生活日記
- 網頁重構
- 美食
- 美食日記
- 虛擬主機
- 謝師宴
- 音樂分享
- 騰訊
- 高雄美食
» PHP 程式設計師必備 Xdebug extension 安裝 on Ubuntu
之前寫了一篇在 FreeBSD 的安裝方式,這次來紀錄如何在 Ubuntu 系統上安裝 Xdebug PHP extension,開發網頁有太多的 debug 工具,其實最重要只要找到合適的開發環境,縮短專案開發程式時間,那底下就是介紹如何安裝在 Ubuntu 12.04 系統上。
系統安裝
透過 Ubuntu 內建程式 apt 安裝即可
# php xdebug
aptitude -y install php5-dev
aptitude -y install php-pear
pecl install xdebug
aptitude -y install php5-dev
aptitude -y install php-pear
pecl install xdebug
啟動 Xdebug
在 Ubuntu 系統,對於 PHP 系統在 /etc/php5 目錄底下分別有 cgi 和 cli 兩個不同目錄,cgi 是用在 Web 而 cli 則是用在 command line,所以其實兩個都是需要設定的。
打開 /etc/php5/cgi/php.ini 和 /etc/php5/cli/php.ini 加入
[xdebug]
zend_extension="/usr/lib/php5/20090626/xdebug.so"
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = /tmp/profiler
zend_extension="/usr/lib/php5/20090626/xdebug.so"
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = /tmp/profiler
如果用 CLI 執行 PHP 可以多加上色彩顯示
xdebug.cli_color = 2
另外最後要把 error message 打開、
display_errors = On
display_startup_errors = On
html_errors = On
display_startup_errors = On
html_errors = On
這樣就可以看到 web 和 cli 輸出錯誤訊息,當然也幫助您用 var_dump 函式來除錯。
Related View
- 好用 PHP debug extension Xdebug on FreeBSD 安裝 (2)
- 在 Ubuntu 底下快速安裝 CakePHP Framework 環境 (0)
- Ubuntu (Debian) 架設 apache mpm worker mod_fcgid 筆記 (0)
- 快速修正專案 PHP Coding Standards (0)
- Ubuntu 停止使用 GUI 介面 12.04 LTS (5)
- 解決 Ubuntu MP3 亂碼 (1)
- 關於 PHP FIG Group 所制定的 PSR-0, PSR-1, PSR-2 (2)
- 寫出好維護的 PHP 程式碼 (13)
- [筆記] 解決 apache mod_fcgid: HTTP request length 136000 (so far) exceeds MaxRequestLen (131072) (0)
- 程式設計師需要注意的 PHP 5.4 變化 (3)











