- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试为 PHP 编写 C 扩展。这是我的 config.m4。直接从helloworld出来,差不多
PHP_ARG_ENABLE(my_ext, whether to enable my_ext support,
[ --enable-my-ext Enable My Ext support])
if test "$PHP_MY_EXT" = "yes"; then
AC_DEFINE(HAVE_MY_EXT, 1, [Whether you have my ext])
PHP_NEW_EXTENSION(my_ext, my_ext.c, $ext_shared)
fi
当我运行 phpize 和 ./configure 时,它会生成一个可用的 Makefile。 到目前为止看起来不错。
现在,如果我向 PHP_NEW_EXTENSION 添加一个附加源文件,事情就会崩溃。根据 here和 here ,调用应如下所示:
PHP_NEW_EXTENSION(foo, foo.c bar.c baz.cpp, $ext_shared)
完整语法:
PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]])
好的,所以我将额外的源文件 (logging.c) 添加到该列表中:
PHP_NEW_EXTENSION(my_ext, my_ext.c, logging.c $ext_shared)
和 phpize/configure 生成一个成功运行但实际上没有构建任何东西的 Makefile。(是的,我已经完成了 make distclean、phpize --clean 等)
我比较了成功的 Makefile 与损坏的 Makefile,区别如下:
$ diff Makefile Makefile.broken
14d13
< shared_objects_my_ext = my_ext.lo
16c15
< PHP_MODULES = $(phplibdir)/my_ext.la
---
> PHP_MODULES =
170,175d168
< $(phplibdir)/my_ext.la: ./my_ext.la
< $(LIBTOOL) --mode=install cp ./my_ext.la $(phplibdir)
<
< ./my_ext.la: $(shared_objects_my_ext) $(MY_EXT_SHARED_DEPENDENCIES)
< $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_my_ext) $(MY_EXT_SHARED_LIBADD)
<
有人知道这是怎么回事吗?
顺便说一句,如果我遗漏了额外的源文件,我会收到关于该文件中函数具有“内部链接但未定义”的编译器警告。
最佳答案
尝试移动第二个逗号
PHP_NEW_EXTENSION(my_ext, my_ext.c, logging.c $ext_shared)
到
PHP_NEW_EXTENSION(my_ext, my_ext.c logging.c, $ext_shared)
如果我对文档的理解正确,第二个参数应该是以空格分隔的来源列表。
关于在 PHP_NEW_EXTENSION 中有多个源文件的 phpize 的 config.m4 生成一个什么都不做的 Makefile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23945160/
我正在尝试按照此处的说明进行操作:https://code.google.com/p/php-sweph/wiki/build编译 PHP 扩展。我的操作系统是 Windows XP。 我找不到“ph
这个问题在这里已经有了答案: How to install and run phpize (18 个答案) 关闭 9 年前。 我正在尝试安装 PECL 扩展,并且需要 phpize。但是当我运行 p
我一直想安装 ffmpeg 作为我的 PHP 设置的扩展。所以在我安装它之前,我需要 phpize 它。我通过 sudo apt-get install php5-dev 安装了 php5-dev。但
我正在尝试在我的 mac 中安装 memcached。我已经下载并安装了它。我也将它添加到 php.ini 中。但是 memcached 仍然没有加载。我意识到问题出在 php 和 phpize 的
我正在尝试在 MacOSx Mountain Lion 上运行“phpize”命令,但这是我得到的: Cannot find config.m4. Make sure that you run '
我正在尝试安装 xdebug,所以我使用了网站上的自定义安装选项,当涉及到“phpize”时,我得到了错误: 找不到 config.m4。 确保在模块的顶级源目录中运行“/usr/bin/phpize
tar -zxvf ImageMagick*.tar.gz cd ImageMagick* phpize ./configure make make install 运行:phpize找不到 conf
我需要我的网站生成 pdf 文件。我正计划使用 PDFlib。当我尝试通过 PEAR 图形界面安装它时,我收到错误消息“sh: phpize: command not found”。有人有什么建议吗?
我在不同的扩展程序上尝试了这些步骤,但我不知道为什么不起作用。在那之后我不应该看到 phpinfo() 输出的变化吗? 步骤: 解压 php 源代码并更改目录到 ext/ext_name phpize
当我运行 PHPIZE 并得到以下错误时,我应该怎么做?我已经安装了 xcode 命令行工具。 grep: /usr/include/php/main/php.h: No such file or d
我正在尝试在 OpenSUSE 12.1 上安装 phpize。我尝试了以下结果。 $ sudo zypper install phpize Loading repository data... Re
我正在尝试在 OpenSUSE 12.1 上安装 phpize。我尝试了以下结果。 $ sudo zypper install phpize Loading repository data... Re
我正在尝试安装 Pecl 扩展 (SCA_SDO),但是当我运行以下命令时 pecl install SCA_SDO 我得到了结果错误: downloading SCA_SDO-1.2.4.tgz .
我尝试安装 xdebug,但收到关于“phpize”的以下错误消息。我该如何解决这个问题? leny:~ nick$ sudo pecl install xdebug Password: downlo
堆栈:PHP 5.4.23、php-fpm、nginx 1.4.x、centos 6.5 我正在尝试安装 xdebug,必须运行 phpize 命令。 我已经安装了 php5-devl 并且 pecl
我想为 PHP 安装 imagick 扩展。但是我在安装时收到错误“phpize”错误 > pecl install imagick-3.1.2 downloading imagick-3.1.2.t
我正在尝试为 PHP 编写 C 扩展。这是我的 config.m4。直接从helloworld出来,差不多 PHP_ARG_ENABLE(my_ext, whether to enable my_ex
我在 OS 10.11 上使用 xampp5.6.15。我在关注这个instruction安装 xDebug。我的“量身定制的安装说明”如下: 在这个指令中,它没有提到把下载的 tgz 文件放在哪里,
我正在尝试在 OS X 10.9 Mavericks 上构建 memcached 扩展,以与内置 PHP 5.4 一起使用,最初我尝试了 pecl install memcached,但结果如下。 c
我正在尝试访问 PHP 中的 rename_function,为此我需要 PECL APD。我运行的是 Ubuntu 14.04 LTS。 我正在尝试运行sudo pecl install apd,但
我是一名优秀的程序员,十分优秀!