实验环境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
或者
[root@localhost etc]# php -m |grep debug
xdebug
Xdebug
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com