出现这个问题的原因
- 主要是因为没有成功的加载so库导致的
解决思路
- 修改config.m4文件中16-18行,打开注释
PHP_ARG_ENABLE(say, whether to enable say support,
Make sure that the comment is aligned:
[ --enable-say Enable say support])
- 再config.m4文件末尾,增加共享库的配置
PHP_ADD_LIBRARY_WITH_PATH(hello, /usr/local/lib/, SAY_SHARED_LIBADD) //指定库名,地址,类型
PHP_SUBST(SAY_SHARED_LIBADD) //发布为共享库
PHP_NEW_EXTENSION(say, say.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS(ext/say, [php_say.h])
- 重新phpize 生成configure文件.
- 编译configure,如果需要,则指定php-config地址
./configure --with-php-config=/usr/local/php/bin/php-config
-
查看makefile文件确认是否有这些
image.png
- make && make install. 不报错即可
网友评论