温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

php 中xdebug安装

发布时间:2020-04-11 02:30:06 来源:网络 阅读:534 作者:13962104417 栏目:web开发

实验环境CentOS


phpinfo()

显示

PHP Version 5.3.3

去官网http://www.xdebug.org/对应下载

xdebug-2.2.5






linux下解压xdebug包。

1、进入xdebug,在这个目录下先运行php目录下面的bin/phpize;


我的机子,运行phpize出错

[root@localhost xdebug-2.2.5]# phpize
-bash: phpize: command not found



安装phpize

phpize是属于php-devel的内容

yum install php-devel -y
[root@localhost xdebug-2.2.5]# phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626


2、在运行

[root@localhost xdebug-2.2.5]#./configure --enable-xdebug 
[root@localhost xdebug-2.2.5]#make

好了,编译结束了。

[root@localhost xdebug-2.2.5]# ll modules/
total 660
-rw-r--r--. 1 root root    923 Oct 17 06:19 xdebug.la
-rwxr-xr-x. 1 root root 668885 Oct 17 06:19 xdebug.so



这是时候会在xdebug的目录下生成 目录modules,目录下有xdebug.so文件,把xdebug.so复制到你想放的目录。


3. 编辑php.ini文件


再php的配置文件后面加上

zend_extension = "/路径/xdebug.so"

如下:

zend_extension="/home/samba/test/xdebug-2.2.5/modules/xdebug.so"
xdebug.profiler_enable = on
xdebug.default_enable = on
xdebug.trace_output_dir="/tmp/xdebug"
xdebug.trace_output_name = trace.%c.%p
xdebug.profiler_output_dir="/tmp/xdebug"
xdebug.profiler_output_name="cachegrind.out.%s"



[root@localhost xdebug-2.2.5]#service httpd restart


phpinfo()

显示


This program makes use of the Zend Scripting Language Engine:

Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans


php 中xdebug安装



或者

[root@localhost etc]# php -m |grep debug
xdebug
Xdebug






向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI