分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 教程案例

phpize建立PHP扩展报错Cannot find config.m4.

发布时间:2023-09-06 02:04责任编辑:胡小海关键词:PHP
首先进入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命令,不报错,问题解决!

phpize建立PHP扩展报错Cannot find config.m4.

原文地址:http://blog.51cto.com/13054614/2144998

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved