美文网首页
vagrant下的centos系统安装xdebug

vagrant下的centos系统安装xdebug

作者: marksdev | 来源:发表于2017-05-22 16:35 被阅读0次

    一.文件准备

    1.打开命令行

    2.进入到agrant所在目录

    3.登录centos系统:

    $ 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.进入程序所在目录

    [vagrant@localhost xdebug]$ cd /home/vagrant/xdebug/

    2.在编译你要添加的扩展模块之前,执行:

    [vagrant@localhost xdebug]$phpize

    3. 编译

    [vagrant@localhost xdebug]$./configure --enable-xdebug --with-php-config=/usr/bin/php-config

    4.

    [vagrant@localhost xdebug]$make

    5. 复制文件:

    [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.复制文件

    [vagrant@localhost xdebug]$cd /tmp

    [vagrant@localhost xdebug]$mkdir xdebug

    [vagrant@localhost xdebug]$sudo chmod -R 777 xdebug/

    8.重启服务器

    [vagrant@localhost xdebug]$sudo nginx restart

    三.测试

    搜索xdebug,若为enable,则安装成功。

    create by marks

    相关文章

      网友评论

          本文标题:vagrant下的centos系统安装xdebug

          本文链接:https://www.haomeiwen.com/subject/erqixxtx.html