栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

开发php扩展

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

开发php扩展

centos 6.8

1,安装gcc

yum -y install gcc make autoconf

2,下载最新版php源码

打开eclipse->file ->new -> c project

项目下有个重要的工具,php-src/ext/ext_skel(自动为我们创建扩展的脚本)

./ext_skel --extname=test(创建名叫test的新扩展)

 cd test   

修改config.m4

这两行比较重要

dnl [  --with-test             Include test support])

dnl [  --enable-test           Enable test support])

变成

PHP_ARG_WITH(test, for test support,

[  --with-test             Include test support])

表示启用了这扩展

phpize(可能出现这个命令不可用,先执行yum install php-devel)

执行完生成一些文件其中有个configure

./configure (执行这个shell脚本)

执行完产生Makefile

执行make

hello.c

static function_entry hello_functions[]

改为

static zend_function_entry hello_functions[]

编译通过了,不知道为啥

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/230085.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号