2016-12-28 104 views
1

从php.ini文件丢失我刚刚安装了最新的XAMPP的PHP 5.6从官方网站,我需要启用Xdebug的,我发现文件php_xdebug.dllC:\xampp\php\ext存在,但没有[XDebug]配置在php.ini在所有和我不知道如何使它发挥作用。它应该被默认安装和预配置,我们只需要取消注释在php.ini的Xdebug的配置,但它并非如此。我甚至尝试使用PECL条命令pecl install xdebug重新安装,但我得到以下错误:的XDebug配置XAMPP

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:\php\pear\docs\xdebug\contrib 

而在当我选择通过在XAMPP目录中选择php.exe补充解释PHPStorm,它说Debugger : Not installed了。

我重新安装了XAMPP,但我仍然有同样的问题。 在此先感谢。

+0

你可以尝试下载其他XAMPP版本,以获得php.ini中的变量或检查Xdebug的文件和刚刚宣布他们:https://xdebug.org/docs/basic –

+0

@FabianoAraujo我做了,但没有其他xampp版本中的xdebug配置也是如此。 – dwix

+0

双重安装东西_never_解决了任何问题。 – arkascha

回答

0

是最安全的方法是使用XDebug wizard,会给你一步如何安装在自己的机器上的操作说明。然后update your php.ini(调你的需求)

注:向导会给你什么SAPI它接收来自phpinfo()内容的指令。所以,如果你填写CLI phpinfo()输出你会得到你的PHP CLI的说明。如果从服务器页粘贴phpinfo()您将获得该指令。

2

这里是一个很好的教程,一步程序 https://hubpages.com/technology/Local-PHP-Debugging-with-XDebug-Atom-and-XAMPP

解释一步按照本教程中,请按照下列步骤操作它的作品就像一个魅力:

步骤来安装的Xdebug:

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

    # navigate to the downloaded file 
    $ cd ~/Downloads 
    
    $ tar -xvzf xdebug-2.4.0.tgz 
    $ cd xdebug-2.4.0 
    
  3. 运行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扩展构建环境。

  4. 配置它的运行:

    $ ./configure 
    
  5. 运行make

    $ make 
    

一个成功的安装将xdebug.so文件中创建。

步骤配置XDebug的:

一个成功的安装将创建xdebug.so并把它放进PHP扩展目录中。

  1. 必须把这个文件复制到XAMPP PHP扩展目录为 运行: -

    $ sudo cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303 
    
  2. 最后更新/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 
    
  3. 重新启动使用XAMPP管理器的Apache-osx

恭喜!你已经完成了!要验证您已成功安装&已配置的XDebug,请在Web浏览器中打开XAMPP phpinfo.php文件,例如http://localhost/dashboard/phpinfo.php

  • 在PHPInfo详细信息中搜索XDebug部分。如果存在,您已成功完成安装 或
  • 在另一个浏览器窗口或选项卡中,打开https://xdebug.org/wizard.php并将第一个窗口或选项卡中的phpinfo.php页面内容复制并粘贴到xdebug.org页面的文本框中。然后提交进行分析,它会给出您的安装状态摘要。
+0

该向导不会为我打开。我得到总结,然后没有别的。 – lenswipe