易截截图软件、单文件、免安装、纯绿色、仅160KB

使用phpize建立php扩展

今天要讲的是linux下php扩展的入门篇
  下面我来讲讲如何作一个php的扩展
  首先要有一个搭建好的php环境
  我把php的安装在了/usr/local/php当然也通过
  php的一个配置php.ini的路径但是要注意了
  用这种方法安装的php扩展不能实现
  我们在php安装以后的/usr/local/php/bin目录
  找到这个文件phpize稍后我们将用到他
  他就是个shell脚本你可以用vi phpize来查看他的内容
  但是你要注意了这个脚本不是在哪里都可以应用的
  [root@ns root]# phpize
  Cannot find config.m4.
  Make sure that you run /usr/local/bin/phpize in the top level source directory of the module
  [root@ns root]# phpize
  Cannot find config.m4.
  Make sure that you run /usr/local/bin/phpize in the top level source directory of the module
  你会看到这两种结果实际上你查看了这个脚本
  很轻松的就会发现是怎么来处理的
  你的模扩展的时候最好
  放在/usr/local/src/php-4.3.5/ext下
  来执行他你在这里也可以这样/usr/local/php/bin/phpize来执行也可以
  phpize来执行
  我们在/usr/local/src/php-4.3.5/ext下找到这个工具
  来建立一个php扩展的一个框架
  [root@ns ext]#cd /usr/local/src/php-4.3.5/ext/
  [root@ns ext]# ./ext_skel --extname=sdomain
  Creating directory sdomain
  Creating basic files: config.m4 .cvsignore sdomain.c php_sdomain.h CREDITS EXPERIMENTAL tests/001.phpt sdomain.php [done].
To use your new extension, you will have to execute the following steps:
  1. $ cd ..
  2. $ vi ext/sdomain/config.m4
  3. $ ./buildconf
  4. $ ./configure --[with|enable]-sdomain
  5. $ make
  6. $ ./php -f ext/sdomain/sdomain.php
  7. $ vi ext/sdomain/sdomain.c
  8. $ make
  执行了这个步骤以后你会看到这样的结果
  Repeat steps 3-6 until you are satisfied with ext/sdomain/config.m4 and
  step 6 confirms that your module is compiled into PHP. Then, start writing
  code and repeat the last two steps as often as necessary.
  这样以后我们会在这个目录下生成一个目录叫sdomain
  进入这里面我们看看
  [root@ns ext]# cd sdomain/
  


相关文档:

PHP好学吗?

          大家好,请教一个问题,麻烦有类似经验的帮帮忙,谢谢各位了!
         本人以前学过两年的.NET,用C#,ASP.NET,Winfrom,SQLServer做过几个网站和小型的管理系统。
现在到一家新公司,要求我学PHP。麻烦高手指点一下,P ......

如何在PHP下载文件名中解决乱码


如何在PHP下载文件名中解决乱码
CND8学院
 PHP教程
 发布日期:2009年05月23日

通过把Content-Type设置为application/octet-stream,可以把动态生成的内容当作文件来下载,相信这个大家都会。那么用Content-Disposition设置下载的文件名,这个也有不少人知道吧。基本上,下载程序都是这么写的:
< ......

PHP文件包含漏洞原理分析和利用方法


摘要:一、涉及到的危险函数〔include(),require()和include_once(),require_once()〕 include()&&require()语句:包括并运行指定文件。这两种结构除了在如何处理失败之外完全一样。include()产生一个警告而require()则导致一个致命错误。换句话说,如果你想在遇到丢失文件时停止处理页面就用require()。include() ......

PHP的ereg()与eregi()的不同及相同点。对比

ereg()
字符串比对解析。
语法: int ereg(string pattern, string string, array [regs]);
返回值: 整数/数组
函数种类: 资料处理
内容说明
本函数以 pattern 的规则来解析比对字符串 string。比对结果返回的值放在数组参数 regs 之中,regs[0] 内容就是原字符串 string、regs[1] 为第一个合乎规则的字符串、regs[2 ......

用PHP实现POP3邮件的解码


初步认识邮件的源文件
    本文简要说明了通过POP3协议收取邮件、MIME邮件的解码的原理;针对收取和MIME解码,提供了两个实用的PHP类,并提供了使用的样例。分为邮件收取、MIME解码两个部分。我们已经向您介绍过了邮件的收取,现在让我们来为您介绍本文的解码部。
    在上一 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号