笔记:
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])
由于