便宜php扩展,php扩展

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出版、作者信息和本声明。否则将追究法律责任。http://blog.jquerycn.cn/mayongzhan - 马永占,myz,mayongzhan

php扩展分为两种.一种是php的扩展,一种是zend扩展.(传说中的,这是programing php里讲的).真的希望能有人发表一些关于zend扩展的东西.这才是真正的核心.

本来是要读下源码的.但是似乎php的源码很多.目前只能扫扫边边角角.如果有机会的话,会去读一下源码的.

其实扩展并不是很难,php已经给好了例子和扩展的工具.使用一下就可以了.

先下php源码,解压

然后到解压目录,ext下 执行./ext_stel --extname=myz然后到解压目录,执行

./buildconf --force

./configure --with-myz=shared --其他的

make

make install

然后就能看到phpinfo()里面多了个myz了.

这里编译了好几次.好象每次都有新问题.多调试几次一定会成功的."妻儿"不舍

附:php源码包中两个重要的文件内容

README.EXT_SKEL

README.SELF-CONTAINED-EXTENSIONS

README.EXT_SKEL

(NOTE: you may also want to take a look at the pear package

PECL_Gen, a PHP-only alternative for this script that

supports way more extension writing tasks and is

supposed to replace ext_skel completely in the long run ...)

WHAT IT IS

It''s a tool for automatically creating the basic framework for a PHP module

and writing C code handling arguments passed to your functions from a simple

configuration file. See an example at the end of this file.

HOW TO USE IT

Very simple. First, change to the ext/ directory of the PHP 4 sources. If

you just need the basic framework and will be writing all the code in your

functions yourself, you can now do

./ext_skel --extname=module_name

and everything you need is placed in directory module_name.

[ Note that GNU awk is likely required for this script to work.  Debian

systems seem to default to using mawk, so you may need to change the

#! line in skeleton/create_stubs and the cat $proto | awk line in

ext_skel to use gawk explicitly. ]

If you don''t need to test the existence of any external header files,

libraries or functions in them, the module is already almost ready to be

compiled in PH

[关闭]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值