简体   繁体   English

在Mac上的xampp上安装xDebug:phpize无法正常工作

[英]Installing xDebug on xampp on mac: phpize not working

I am using xampp5.6.15 on OS 10.11. 我在OS 10.11上使用xampp5.6.15。 I was following this instruction to install xDebug. 我按照这条指令安装xDebug。 My "tailored installation instruction" is as follows: 我的“量身定制的安装说明”如下: 在此输入图像描述

In this instruction, it doesn't mention where to put the downloaded tgz file, so I just left it where it was in the downloads folder, after I ran phpize , the output is like this: 在这个说明中,它没有提到下载tgz文件的位置,所以我把它放在了downloads文件夹中,在我运行phpize ,输出如下:

grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_modules.h: No such file or directory grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory Configuring for: PHP Api Version: grep:/usr/include/php/main/php.h:没有这样的文件或目录grep:/usr/include/php/Zend/zend_modules.h:没有这样的文件或目录grep:/ usr / include / php / Zend /zend_extensions.h:没有这样的文件或目录配置:PHP Api版本:
Zend Module Api No: Zend Module Api No:
Zend Extension Api No: Zend Extension Api No:
Cannot find autoconf. 找不到autoconf。 Please check your autoconf installation and the $PHP_AUTOCONF environment variable. 请检查您的autoconf安装和$ PHP_AUTOCONF环境变量。 Then, rerun this script. 然后,重新运行此脚本。

I guess it is because the xdebug folder is not in the right place, I've tried moving it to xamppfiles/ and xamppfiles/modules/ and some other places but none of the works. 我想这是因为xdebug文件夹不在正确的位置,我已经尝试将它移动到xamppfiles/xamppfiles/modules/以及其他一些地方,但没有任何工作。

So what is wrong? 那有什么不对? Where should I place the folder? 我应该在哪里放置文件夹?

I just was struggling with the same problem and got the below message when I tried to run phpize to install xdebug. 当我试图运行phpize来安装xdebug时,我正在努力解决同样的问题并得到以下消息。 The solution (and problem) in my case was that I just had not installed the XAMPP developer files! 我的解决方案(和问题)是我刚刚没有安装XAMPP开发人员文件! When you run the XAMPP installer, you can check or uncheck this option. 运行XAMPP安装程序时,可以选中或取消选中此选项。 If you did not originally check it, just run the installer again, it allows you to just add the developer files. 如果您最初没有检查它,只需再次运行安装程序,它允许您只添加开发人员文件。

And just to be complete: I also had an issue with the wrong version of php / phpize (the older OSX version was used), so I also had to set the path to the XAMPP versions of php, phpize etc. are stored: 并且只是为了完成:我也遇到了错误版本的php / phpize的问题(使用了较旧的OSX版本),所以我还必须设置php,phpize等XAMPP版本的路径存储:

export PATH=/Applications/XAMPP/xamppfiles/bin/:$PATH

Afterwards, everything was fine, and I could just follow the steps the XDEBUG wizard gave me: https://xdebug.org/wizard.php 之后,一切都很好,我可以按照XDEBUG向导给我的步骤进行操作: https ://xdebug.org/wizard.php

This was the original error message I got by runnin phpize: 这是我通过runnin phpize获得的原始错误消息:

grep: /Applications/XAMPP/xamppfiles/include/php/main/php.h: No such file or directory grep:/Applications/XAMPP/xamppfiles/include/php/main/php.h:没有这样的文件或目录
grep: /Applications/XAMPP/xamppfiles/include/php/Zend/zend_modules.h: No such file or directory grep:/Applications/XAMPP/xamppfiles/include/php/Zend/zend_modules.h:没有这样的文件或目录
grep: /Applications/XAMPP/xamppfiles/include/php/Zend/zend_extensions.h: No such file or directory grep:/Applications/XAMPP/xamppfiles/include/php/Zend/zend_extensions.h:没有这样的文件或目录
Configuring for: 配置:
PHP Api Version: PHP Api版本:
Zend Module Api No: Zend Module Api No:
Zend Extension Api No: Zend Extension Api No:

I think you are missing two things : 我想你错过了两件事:

  • PHP Sources PHP来源

I don't know XAMPP so I can't help here. 我不知道XAMPP所以我不能在这里帮忙。 Maybe the PHP sources are packaged with XAMPP, have a look. 也许PHP源代码与XAMPP一起打包,看看吧。

  • autoconf autoconf的

Try to install autoconf with 尝试安装autoconf

brew install autoconf

In xdebug source directory provide full path to XAMPP php binaries: 在xdebug源目录中提供XAMPP php二进制文件的完整路径:

$ cd xdebug-2.5.0
$ /Applications/XAMPP/xamppfiles/bin/phpize
$ ./configure --enable-xdebug --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config
$ make

Next place modules\\xdebug.so to Extensions directory (see tailored installation instructions). 接下来将modules \\ xdebug.so放到Extensions目录中(参见定制的安装说明)。

Maybe you can solve the problem like: 也许你可以解决这个问题:

1. cd xdebug-2.5.4 1. cd xdebug-2.5.4
2. /Applications/XAMPP/xamppfiles/bin/phpize 2. /Applications/XAMPP/xamppfiles/bin/phpize

If you do not have home-brew please install it: https://brew.sh/ 如果你没有家酿,请安装它: https//brew.sh/

3. brew install autoconf 3. brew install autoconf
4. ./configure --enable-xdebug --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config 4. ./configure --enable-xdebug --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config

Don't forget to run 'make test': 不要忘记运行'make test':
5. make make
6. make test 6. make test
7. cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012 7. cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012

Edit /Applications/XAMPP/xamppfiles/etc/php.ini: 编辑/Applications/XAMPP/xamppfiles/etc/php.ini:
8. vi /Applications/XAMPP/xamppfiles/etc/php.ini 8. vi /Applications/XAMPP/xamppfiles/etc/php.ini
9.And add the line: 9.并添加行:
zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so

10.Restart your webserver. 10.重新启动您的网络服务器。

My hope that this approach be helpful to you. 我希望这种方法对你有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM