linux 安装xdebug
一、安装了 xdebug
php -m | grep 'xdebug'
如果没有安装就执行
首先根据 phpinfo() 信息 下载对应的版本,具体看参数:
下载地址:https://xdebug.org/download
把phpinfo()的打印信息 复制到 https://xdebug.org/wizard 下,可以得到安装信息
-1.下载xdebug
wget https://xdebug.org/files/xdebug-2.7.0.tgz -2.解压
tar -zxvf xdebug-2.7.0.tgz
cd xdebug-2.7.0
-3.运行phpize,通过phpize可以 生成 configure 文件,动态的添加php扩展
phpize 或者 /usr/bin/phpize7.2 -4. 配置,--with-php-config=/你php的bin路径/php-config
./configure --enable-xdebug --with-php-config=/usr/bin/php-config7.2 -5.编译&生成
make && make install
编译&&生成后,屏幕上会有输出
installing shared extensions: /usr/lib/php/20170718/
+----------------------------------------------------------------------+
| |
| INSTALLATION INSTRUCTIONS |
| ========================= |
| |
| See http://xdebug.org/install.php#configure-php for instructions |
| on how to enable Xdebug for PHP. |
| |
| Documentation is available online as well: |
| - A list of all settings: http://xdebug.org/docs-settings.php |
| - A list of all functions: http://xdebug.org/docs-functions.php |
| - Profiling instructions: http://xdebug.org/docs-profiling2.php |
| - Remote debugging: http://xdebug.org/docs-debugger.php |
| |
| |
| NOTE: Please disregard the message |
| You should add "extension=xdebug.so" to php.ini |
| that is emitted by the PECL installer. This does not work for |
| Xdebug. |
| |
+----------------------------------------------------------------------+
编译安装完成后会有一个 modules文件夹,该文件夹下有一个xdebug.so的文件,将此文件复制到对应PHP版本的扩展目录即可。当然,如果PHP已经设置了扩展目录地址,该文件就会自动复制到了扩展目录中,
如:我的扩展目录是 /usr/lib/php/20170718/ ,目录下面会生成一个 xdebug.so 的动态库文件
说明: /usr/lib/php/20170718/ 该目录是存放PHP扩展的目录,phpinfo()里看到 extension_dir 该属性的值。
二、PHP 配置文件添加配置
vim /usr/local/php/etc/php.ini - 添加
zend_extension=xdebug.so # 这里没有写绝对路径,是因为会到扩展目录中去找
xdebug.remote_enable =
xdebug.remote_connect_back =
xdebug.remote_port =
xdebug.max_nesting_level = - 保存退出
三、重启PHP
service php-fpm restart
四、查看
通过 phpinfo() 输出查看,或者 通过命令 php -m | grep 'xdebug'
注意事项
最新文章
- Google Chrome浏览器中如何使用命令
- ecshop的几个小瑕疵
- ARM堆栈及特殊指令
- poj1180
- 24篇Delphi文件操作文章
- DDD设计一个电商网站
- windows 下编译php扩展库pecl里的扩展memcache
- javascript执行原理
- java :equals()和hashcode()方法的结合使用
- MongoDB的mongos实例因无法分配mlock内存挂掉
- iOS中 UITableViewRowAction tableViewcell编辑状态下的功能 UI技术分享
- 【python】多进程共享变量Manager
- ThinkPHP设计模式与Trait技术
- NumsCount
- PYTHON-面向对象-练习-王者荣耀 对砍游戏
- SQLite中SELECT基本形式
- “无法获得锁 /var/lib/dpkg/lock -open (11:资源暂时不可用)”的方法
- 【springboot】之整合ActiveMQ
- Mac Oracle SqlDeveloper 快捷输入
- 关于JavaScript中name的意义冲突