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

来源:互联网 发布:mac ssh命令 端口 编辑:程序博客网 时间:2024/06/05 04:16

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
原创粉丝点击