Home > Backend Development > PHP Tutorial > PHP模块编写

PHP模块编写

WBOY
Release: 2016-06-23 14:31:12
Original
1185 people have browsed it

开发PHP Module

1、首先进入PHP源代码目录中的ext目录,执行如下命令:

# ./ext_skel --extname=自定义模块名

执行完成后,会生成以“自定义模块名”命名的文件夹,进入这个文件夹后编辑config.m4文件

找到如下代码:

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

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

去掉每行前面的dnl

2、编写调用函数(参考之前三篇模块编写的文章)

3、编译:

  使用传统的php模块编译方法:

    phpize

    ./configure

    make

    make install

4、然后把模块extension进来,ok!可以使用自己的模块啦!这些是最基本的操作,接下来就看自己的C语言功底啦!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template