博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
phpize建立PHP扩展报错Cannot find config.m4.
阅读量:7206 次
发布时间:2019-06-29

本文共 1104 字,大约阅读时间需要 3 分钟。

首先进入PHP的源码安装包目录下面执行一条命令:

cd /home/oldboy/tools/php-5.5.32/ext/./ext_skel --extname=redis

然后进入到扩展目录,可以看到如下三个文件,分别进行编辑:

cd redis/lsconfig.m4    redis.c    php_redis.h

操作前养成备份的习惯

按照顺序先编辑config.m4

> dnl PHP_ARG_ENABLE(redis, whether to enable redis support,> dnl Make sure that the comment is aligned:> dnl [  --enable-redis           Enable redis support])

修改为

< PHP_ARG_ENABLE(redis, whether to enable redis support,< [  --enable-redis           Enable redis support])

保存退出

然后编辑redis.c

在这段添加一行代码:PHP_FE(say_hello, NULL)

const zend_function_entry redis_functions[] = {        PHP_FE(say_hello,       NULL)        PHP_FE(confirm_redis_compiled,  NULL)           /* For testing, remove later. */        PHP_FE_END      /* Must be the last line in redis_functions[] */};

在文件末尾添加如下代码:

PHP_FUNCTION(say_hello){        zend_printf("hello redis!");}

保存退出

最后编辑php_redis.h

在这段添加一行代码:PHP_FUNCTION(say_hello)

PHP_FUNCTION(confirm_redis_compiled);   /* For testing, remove later. */PHP_FUNCTION(say_hello); /* For testing, remove later. */

保存退出

不出意外此时可以执行phpize命令,不报错,问题解决!

转载于:https://blog.51cto.com/13054614/2144998

你可能感兴趣的文章
mac下配置openfire
查看>>
自定义控件实现(转)
查看>>
如何确认访客所在的国家
查看>>
跟着8张思维导图学习javascript
查看>>
InnoSQL/MySQL并行复制的实现与配置
查看>>
JDBC连接MySQL数据库及演示样例
查看>>
第38周五
查看>>
windows下Emacs的安装与配置
查看>>
WF4 常用类<第二篇>
查看>>
mongo文件空间
查看>>
NSArray中存的是实体时的排序
查看>>
搜索框中“请输入搜索keyword”
查看>>
CentOS6.5与XP双系统安装
查看>>
Python 更新set
查看>>
shell语法简单介绍
查看>>
Web服务器的工作原理
查看>>
使用WinSetupFromUSB来U盘安装windowsXP(不使用win PE系统)
查看>>
JAVA Calendar具体解释
查看>>
MongoDB入门简单介绍
查看>>
Git show-branch显示提交信息
查看>>