当前位置: 首页 > 知识库问答 >
问题:

在Mac上安装带有XAMPP的XDebug for PHP

巫马承德
2023-03-14

我有一台新安装OSX Mojave的Mac电脑。我下载了XAMPP(7.3)并安装了它。本地ApacheWeb服务器工作正常,我从仪表板获得的PHPInfo()显示了php的所有正确信息。ini文件为/Applications/XAMPP/xamppfiles/etc/php。伊尼。

我已经复制了一份PHPInfo,并将其放在向导中:

https://xdebug.org/wizard.php

说明书看起来很简单。我确实必须使用自制先安装autoconf。

但是后来我能够下载并解包xdebug-2.6。1.tgz,位于/Applications/XAMPP/xamppfiles/文件夹中。

我将$PATH变量更改为 /Applications/XAMPP/xamppfiles/bin搜索的第一个路径,以便正确的phpize将运行。

我改为/Applications/XAMPP/xamppfiles/xdebug-2.6。1文件夹并运行phpize,然后我运行/配置。一切似乎都运行良好,没有明显的错误。

但是,当我运行“make”命令时,出现了错误。以下是我得到的输出:

> Terrys-MacBook-Pro:xdebug-2.6.1 terry$ make /bin/sh
> /Applications/XAMPP/xamppfiles/xdebug-2.6.1/libtool --mode=compile cc 
> -I. -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1 -DPHP_ATOM_INC -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1/include -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1/main -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1 -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /Applications/XAMPP/xamppfiles/xdebug-2.6.1/xdebug_compat.c -o
> xdebug_compat.lo   cc -I.
> -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1 -DPHP_ATOM_INC -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1/include -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1/main -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1 -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Applications/XAMPP/xamppfiles/xdebug-2.6.1/xdebug_compat.c 
> -fno-common -DPIC -o .libs/xdebug_compat.o /Applications/XAMPP/xamppfiles/xdebug-2.6.1/xdebug_compat.c:56:71:
**> error: too few arguments to function call, expected 6, have 5**
>         return zend_get_zval_ptr(op_type, node, zdata, &should_free, BP_VAR_R);
>                ~~~~~~~~~~~~~~~~~                                             ^
> /Applications/XAMPP/xamppfiles/include/php/Zend/zend_execute.h:330:1:
> note: 'zend_get_zval_ptr' declared here ZEND_API zval
> *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type); ^ /Applications/XAMPP/xamppfiles/include/php/main/php_config.h:9:19:
> note: expanded from macro 'ZEND_API'
> # define ZEND_API __attribute__ ((visibility("default")))
>                   ^ /Applications/XAMPP/xamppfiles/xdebug-2.6.1/xdebug_compat.c:194:88:
> error: too few arguments to function call, expected 9, have 8
>         php_setcookie(name_s, value_s, expires, path_s, domain_s, secure, url_encode, httponly);
>         ~~~~~~~~~~~~~                                                                         ^ /Applications/XAMPP/xamppfiles/include/php/ext/standard/head.h:40:1:
> note: 'php_setcookie' declared here PHPAPI int
> php_setcookie(zend_string *name, zend_string *value, time_t expires,
> zend_string *path, zend_string *domain, int secure, int httponly,
> zend_string *samesite, int url_encode); ^
> /Applications/XAMPP/xamppfiles/include/php/main/php.h:72:18: note:
> expanded from macro 'PHPAPI'
> #               define PHPAPI __attribute__ ((visibility("default")))
>                               ^ 2 errors generated. make: *** [xdebug_compat.lo] Error 1

所以我在“make”命令中看到的第一个错误是

我不知道从这里去哪里。我读到的无穷无尽的文档似乎要么是针对个人电脑的,要么是针对PHP 5的。

共有2个答案

温成济
2023-03-14

汉尼拔是正确的,但他的回答有点简练,所以我想进一步阐述一下。

这是PHP 7.3. x的XDebug错误,因此您需要安装XDebug 2.7.0beta1:

$pecl安装xdebug-2.7。0beta1

由于我使用自制软件安装了最新的PHP版本,XDebug安装实际上抛出了两个mkdir()错误。这是因为在自制的PHP目录中已经有一个peclsymlink。

首先我想验证一下,所以我运行了$ls-al /usr/local/Cellar/php/

如果您对您的PHP版本有任何疑问,它应该出现在安装日志中,并与mkdir()错误并列。

一旦我确认那里已经有一个符号链接,我就将其删除:

rm /usr/local/Cellar/php

在我这样做之后,我再次运行安装程序,它运行得很顺利。

当然,$php--ini显示了错误,所以我必须正确配置php。Gabor Javorsky实际上写了一篇很棒的文章,其中包括如何确保正确加载XDebug,并且它对我来说非常适合。请参见他文章中的第2步:https://javorszky.co.uk/2018/05/03/getting-xdebug-working-on-php-7-2-and-homebrew/.

别忘了在调整配置后重新加载PHP,这对我来说是:

$brew服务停止php@7.2

之后,$php--ini应该不会显示任何错误!

齐志勇
2023-03-14

有一个错误。因此,联系是:https://bugs.xdebug.org/view.php?id=1593

它描述了您需要使用Xdebug 2.7。现在是0beta1。

 类似资料:
  • 我使用的是XAMPP版本5.6。Mac OS X 10.10上的3-0。3约塞米蒂和我想安装Gmagick(https://pecl.php.net/package/gmagick)graphicsmagic的PHP API扩展。(http://www.graphicsmagick.org) 所以我下载了gmagick并将其编译为php: 然后我将其添加到php中。ini: 但该扩展未处于活动状态

  • 我想安装多个XAMPP版本。 在< code>NivF007对如何在mac-os-x-10-7上安装多个xampp版本或多个php版本的问题的回答中,有这样一句话 将 XAMPP 的每个实例安装在它自己的文件夹中 但你怎么能做到这一点呢?(因为您无法更改安装目录) 当您在安装管理器后重命名 XAMPP 文件夹时不起作用。

  • I使用macOS High Sierra 10.13.1版 我想在我的Mac电脑上安装两个xampp(xampp 7.0.27和xampp 7.1.13) 首先,我在我的Mac中安装了xampp 7.0.27并且它可以工作。它存储在中 其次,我尝试在我的Mac上安装xampp 7.1.13。似乎失败了。因为它也存储在XAMPP中。似乎不习惯这条路 我该如何解决这个问题?

  • 问题内容: 我已经在Windows XP上安装了xampp 1.7.4和php版本5.3.5。如何在Windows XP上使用PHP 5.3.5在Xampp中安装ffmpeg? 问题答案: 您可以从此处开始执行以下步骤,也可以执行以下步骤。 从此处下载ffmpeg:https://ffmpeg.org/download.html 将php_ffmpeg.dll从php5文件夹复制到C:\ wamp

  • 问题内容: 我需要在XAMPP的Mac上使用扩展名intl。 因此,我遵循了以下链接: XAMPP for Mac Lion 10.8上的php- intl安装 http://lvarayut.blogspot.it/2013/09/installing-intl-extension-in- xampp.html 我总是重新启动我的apache服务器,但是没有安装扩展名。因为如果我启动: 返回空

  • 我搜索了如何在同一台机器上安装php5和php7,但没有找到答案。 我正在做两个不同的项目,一个依赖于php5,另一个依赖于php7 我在linux上使用xampp 如何运行两个版本的php 5