编写PHP扩展库步骤

笔记:

1、下载PHP源码,然后解压缩,假设路径为:/home/wyq/php-7.3.0,给目录添加可执行权限,

chmod -R +x ./

2、进入/home/wyq/php-7.3.0/ext/目录,最好给

然后执行

 ./ext_skel --extname=wyq

其中wyq就是扩展库的名称,wyq.so,

3、之后会在ext目录下生成wyq目录,进入wyq目录查看会生成如下文件:

CREDITS  EXPERIMENTAL  config.m4  config.w32  wyq.c  wyq.php  php_wyq.h  tests

4、编写config.m4文件,把对应的注释去掉,dnl是注释的意思

dnl If your extension references something external, use with:

dnl PHP_ARG_WITH(hello, for hello support,
dnl Make sure that the comment is aligned:
dnl [  --with-hello             Include hello support])

dnl Otherwise use enable:

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

由于

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值