新手搞PHP ,之前用过 PERL, BASH; 所以开始用PHP 写程序上手比较快, 几天之后对PHP 的内部实现机制产生了兴趣,所以自己尝试着写写简单的PHP 扩展,以增加对PHP 的理解。

 
一 环境
Ubuntu 12.04
PHP 5.3.10
 
二 步骤
1, 下载PHP 源代码(php5.3.10)并解压到本地
2 , cd到PHP 源代码的根目录下
3, cd到ext/目录下
4, 使用ext_skel 脚本自动生成代码stub ext_skel --extname=module_name
5, 根据ext_skel的提示一次执行
  1. 5.1 $ cd ..
  2. 5.2. $ vi ext/example/config.m4
  3. 5.3. $ ./buildconf
  4. 5.4. $ ./configure --[with|enable]-example
  5. 5.5. $ make
  6. 5.6. $ ./php -f ext/example/example.php
  7. 5.7. $ vi ext/example/example.c
  8. 5.8. $ make
6, 新生成的example module的stub代码当中,执行
phpize --生成congifure 和config.h
  1. ./configure --[with|enable]-example
  2. make
  3. make test
  4. sudo make install
 
6修改php.ini,添加新开发的module
php -i
php -m
 
 

PHP Extension的更多相关文章

  1. Windbg Extension NetExt 使用指南 【2】 ---- NetExt 的基本命令介绍

    摘要 : 本章节介绍NetExt常用的命令. 并且对SOS进行一些对比. NetExt的帮助 要想玩好NetExt, 入门就得看帮助. 看NetExt的帮助可以调用!whelp 命令. 这样hi列举出 ...

  2. Windbg Extension NetExt 使用指南 【1】 ---- NetExt 介绍

    摘要 : 在使用WINDBG做debugging的时候,需要一个好的工具帮助进行数据分析. 最常见的extension包括SOS, PSSCOR.  NetExt则是另外一种提供了丰富命令功能的deb ...

  3. 「译」JUnit 5 系列:扩展模型(Extension Model)

    原文地址:http://blog.codefx.org/design/architecture/junit-5-extension-model/ 原文日期:11, Apr, 2016 译文首发:Lin ...

  4. PHPmailer关于Extension missing: openssl报错的解决

    最近在写一个网页的时候,需要用到PHPmailer来发送邮件,按照官网上给出的demo写出一个例子,却报错Extension missing: openssl 最后发现需要修改php.ini中的配置: ...

  5. 研究Extension和Category的一个例子

    Category: 1. 无法添加实例变量 2.将类的实现分散到多个不同文件或多个不同框架中. Extension: 1. 可以添加实例变量 注: 如果Category的头文件中也使用Extensio ...

  6. App Extension访问Cocoapods引入的第三方库

    步骤一: PROJECT --info --configurations,将对应的Debug和Release 设置成pods.debug和pods.release    步骤2:编译一下(本人遇到的问 ...

  7. Chrome Extension 检查视图(无效)处理方法

    最近闲来无事,简单看了下Chrome扩展的开发,并且开发一个小小的翻译插件(TranslateBao)作为练手,开发细节不详述了,如果有新学习chrome extension开发的新人,可以参考源码, ...

  8. debian下使用Sphinx异常“Could not import extension sphinx.builders.linkcheck (exception: cannot import name SSLError)”的解决

    最近使用到Sphinx编译文档,出现如下异常: Extension error:Could not import extension sphinx.builders.linkcheck (except ...

  9. SQL Server 2014新特性探秘(2)-SSD Buffer Pool Extension

    简介     SQL Server 2014中另一个非常好的功能是,可以将SSD虚拟成内存的一部分,来供SQL Server数据页缓冲区使用.通过使用SSD来扩展Buffer-Pool,可以使得大量随 ...

  10. sharepoint2013爬xls文件:Error initializing IFilter for extension的解决方案

    最近sharepoint2013爬网出现: error initializing IFilter for extension '.xls' (Error code is 0x80030002). Th ...

随机推荐

  1. YYLabel计算富文本高度-膜拜大神

    http://www.jianshu.com/p/07cd655fee7e YYTextLayout *layout = [YYTextLayout layoutWithContainerSize:C ...

  2. iOS开发tableView去掉顶部上部空表区域

    tableview中的第一个cell 里上部 有空白区域,大概64像素 在viewDidLoad中加入如下代码 self.automaticallyAdjustsScrollViewInsets = ...

  3. Joint Stacks---hdu5818(栈模拟)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5818  有3个操作pop,push,merge A B; 引入一个新的栈C,每次合并的时候就把A和B合 ...

  4. hibernate注解(一)JoinColumn

    @Entity @Table(name="t_group") public class Group { private int id; private String name; p ...

  5. 模仿linux内核定时器代码,用python语言实现定时器

    大学无聊的时候看过linux内核的定时器,如今已经想不起来了,也不知道当时有没有看懂,如今想要模仿linux内核的定时器.用python写一个定时器,已经想不起来它的设计原理了.找了一篇blog,li ...

  6. 启动InnoDB引擎的方法

    启动InnoDB引擎的方法 http://down.chinaz.com/server/201207/2090_1.htm 启动InnoDB引擎的方法 Mysql中默认的是MyISAM数据引擎,可惜此 ...

  7. Ubuntu单用户模式(安全模式)

           说下我遇到的情况,ubuntu服务器,防火墙关闭,连的外网.服务器中毒,病毒自动生成用户,然后病毒进程开启启动,进程启动后,cpu立马占满,服务器立马卡死,本想着服务器启动后通过top命 ...

  8. 设置pip的默认源

    Python在导入第三方模块的时候用设置豆瓣源的方法提高效率,每次设置很麻烦,所以通过下面方法设置默认源,这样就可以直接pip install package,而不用指定源了. [global] ti ...

  9. [LeetCode]94, 144, 145 Binary Tree InOrder, PreOrder, PostOrder Traversal_Medium

    Given a binary tree, return the inorder, preorder, postorder traversal of its nodes' values. Example ...

  10. NSLog打印NSInteger老是有warning

    zSpecifies that a following [...] conversion specifier applies to a size_t or the corresponding sign ...