XAMPP 中的 php.ini 中缺少 XDebug 配置 [英] XDebug configuration missing from php.ini in XAMPP

查看:28
本文介绍了XAMPP 中的 php.ini 中缺少 XDebug 配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚从官网安装了最新的XAMPP for PHP 5.6,需要开启Xdebug,我发现php_xdebug.dll文件存在于C:xamppphpext ,但在 php.ini 中根本没有 [XDebug] 配置,我不知道如何使它工作.它应该默认安装并预先配置,我们只需要取消注释 php.ini 中的 xdebug 配置,但事实并非如此.我什至尝试使用 PECL commmand pecl install xdebug 再次安装它,但我收到以下错误:

I've just installed the latest XAMPP for PHP 5.6 from the official website, and I need to enable Xdebug, I find that the file php_xdebug.dll exists in the C:xamppphpext , but there is no [XDebug] config at all in the php.ini and I have no idea how to make it work. It should be installed by default and pre-configured, we need just to uncomment the xdebug config in php.ini but it's not the case. I even tried to install it again using PECL commmand pecl install xdebug but I get the following error :

pecl install xdebug
downloading xdebug-2.5.0.tgz ...
Starting to download xdebug-2.5.0.tgz (267,640 bytes)
.........done: 267,640 bytes
ERROR: failed to mkdir C:phppeardocsxdebugcontrib

在 PHPStorm 中,当我选择通过选择 XAMPP 目录中的 php.exe 添加解释器时,它也显示 Debugger : Not installed.

And in PHPStorm when I choose to add the interpreter by selecting the php.exe in the XAMPP directory, it says Debugger : Not installed too.

我重新安装了 XAMPP,但我仍然遇到同样的问题.提前致谢.

I re-installed XAMPP, but I still have the same problem. Thanks in advance.

推荐答案

更多详细信息,您可以找到一个逐步说明过程的教程php-debugging-with-xdebug-atom-and-xampp

For more details, you can find a tutorial that explains step by step procedure php-debugging-with-xdebug-atom-and-xampp

按照本教程,请按照以下步骤操作,它的作用就像一个魅力:

As per this tutorial please follow these steps its works like a charm:

安装 Xdebug 的步骤:

  1. 下载xdebug-2.4.0.tgz
  2. 解压下载的文件

  1. Download xdebug-2.4.0.tgz
  2. Unpack the downloaded file

# navigate to the downloaded file
$ cd ~/Downloads

$ tar -xvzf xdebug-2.4.0.tgz
$ cd xdebug-2.4.0

  • 运行 phpize

  • run phpize

    $ phpize
    
    # example output
    Configuring for:
    PHP Api Version:         20131106
    Zend Module Api No:      20131226
    Zend Extension Api No:   220131226
    
    #Error possibilty
    Cannot find autoconf. Please check your autoconf installation and the
    $PHP_AUTOCONF environment variable. Then, rerun this script.
    
    #In the above error case you need to install autoconf using below command(MAC) and rerun phpize
    $ brew install autoconf
    

    phpsize 命令用于准备构建环境PHP 扩展.

    The phpsize command is used to prepare the build environment for a PHP extension.

    运行配置:

    $ ./configure
    

  • 运行make

  • run make

    $ make
    

  • 成功安装将创建 xdebug.so 文件.

    A successful install will have created xdebug.so file.

    配置 Xdebug 的步骤:

    成功安装将创建 xdebug.so 并将其放入 PHP 扩展目录.

    A successful install will have created xdebug.so and put it into the PHP extensions directory.

    1. 为此,您必须将此文件复制到 XAMPP php 扩展目录运行:-

    1. You must copy this file to XAMPP php extension directory for that run:-

    $ sudo cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303
    

  • 最后更新 /Applications/XAMPP/xamppfiles/etc/php.ini 并添加以下几行

    [Xdebug]
    zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
    xdebug.remote_enable=1
    xdebug.remote_connect_back=On
    xdebug.remote_port="9000"
    xdebug.profiler_enable=0
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.remote_autostart=true
    

  • 使用 XAMPP 的 manager-osx 重启 Apache
  • 恭喜!你已经完成了!!验证您是否成功安装 &配置XDebug,在网页浏览器中打开XAMPP phpinfo.php 文件,例如http://localhost/dashboard/phpinfo.php.

    Congratz! You have completed!! To verify you successfully installed & configured XDebug, open the XAMPP phpinfo.php file in a web browser, for example, http://localhost/dashboard/phpinfo.php.

    • 在 PHPInfo 详细信息中搜索 XDebug 部分.如果存在,则您已成功完成安装或
    • 在另一个浏览器窗口或选项卡中,打开 https://xdebug.org/wizard.php并复制第一个窗口或选项卡中的 phpinfo.php 页面内容并将其粘贴到 xdebug.org 页面上的文本框中.然后提交分析,它会给出你的安装状态的总结.
    • Search for XDebug section in PHPInfo details. If it exists, you successfully have done your installation OR
    • In another browser window or tab, open https://xdebug.org/wizard.php and copy the phpinfo.php page content in the first window or tab and paste it into the textbox on the xdebug.org page. Then submit for analysis, it will give a summary of your installation status.

    这篇关于XAMPP 中的 php.ini 中缺少 XDebug 配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆