linux下php扩展开发入门之hello word

1、进入php源码ext目录 执行 ./ext_skel --extname=helloworld

参数--extname=是指定扩展名

2、进入去helloworld目录,掉config.m4中几行注释

3、在php源码根目录执行命令 ./buildconf --force

4、 ./configure --with-helloworld

5、进入我们的扩展目录helloworld,执行命令 phpize

6、 ./configure --with-php-config=/usr/bin/php-config(使用你自己环境的php-config) --enable-helloworld

7、进入扩展helloworld目录,编辑文件php_helloworld.h,在最后一行添加函数PHP_FUNCTION(helloworldTest);

8、用vim 打开helloword.c,在helloworld.c中实现我们的函数,之后 将helloworldTest函数加入到helloworld_functions[]中

9、执行make命令 make 编译扩展

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值