一.文件準(zhǔn)備
1.打開命令行
2.進(jìn)入到agrant所在目錄
3.登錄centos系統(tǒng):
$ vagrant ssh
Last login: Mon Oct 17 04:24:48 2016 from 10.0.2.2
4.下載xdebug程序
[vagrant@localhost ~]$ git clone git://github.com/xdebug/xdebug.git
Initialized empty Git repository in /home/vagrant/xdebug/.git/
remote: Counting objects: 16418, done.
remote: Total 16418 (delta 0), reused 0 (delta 0), pack-reused 16418
Receiving objects: 100% (16418/16418), 5.92 MiB | 326 KiB/s, done.
Resolving deltas: 100% (11163/11163), done.
5.打開已下載的文件夾
[vagrant@localhost ~]$ cd xdebug/
6.檢查php-config安裝路徑
[vagrant@localhost xdebug]$ sudo find / -name "php-config"
/usr/bin/php-config
[vagrant@localhost xdebug]$
二.安裝程序
1.進(jìn)入程序所在目錄
[vagrant@localhost xdebug]$ cd /home/vagrant/xdebug/
2.在編譯你要添加的擴(kuò)展模塊之前嫩海,執(zhí)行:
[vagrant@localhost xdebug]$phpize
3. 編譯
[vagrant@localhost xdebug]$./configure --enable-xdebug --with-php-config=/usr/bin/php-config
4.
[vagrant@localhost xdebug]$make
5. 復(fù)制文件:
[vagrant@localhost xdebug]$cp modules/xdebug.so /tmp/xdebug.so
6.修改php.ini(建議在phpinfo();里面看php.ini文件路徑)
[vagrant@localhost xdebug]$sudo vi /etc/php.ini
新增以下:
[Xdebug]
zend_extension =/tmp/xdebug.so
xdebug.auto_trace = on
xdebug.auto_profile = on
xdebug.collect_params = on
xdebug.collect_return = on
xdebug.profiler_enable = on
xdebug.trace_output_dir = "/tmp/xdebug"
xdebug.profiler_output_dir = "/tmp/xdebug"
xdebug.dump.GET = *
xdebug.dump.POST = *
xdebug.dump.COOKIE = *
xdebug.dump.SESSION = *
xdebug.var_display_max_data = 4056
xdebug.var_display_max_depth = 5
7.復(fù)制文件
[vagrant@localhost xdebug]$cd /tmp
[vagrant@localhost xdebug]$mkdir xdebug
[vagrant@localhost xdebug]$sudo chmod -R 777 xdebug/
8.重啟服務(wù)器
[vagrant@localhost xdebug]$sudo nginx restart
三.測試
搜索xdebug荚板,若為enable既绕,則安裝成功召边。