The original PHP module is not very difficult to write, including the following articles: Write your own php extension function Zend Manual This article is mainly about the compilation Process 1 find PHP source code, unzip (if you have installed the original installation source code) 2 Use the tool "Ext_ske L "Initialize the module code, this tool for you to write well, some necessary code." Tool Location:/ext/ext_skel How to use: Ext_skel--extname= module name first into the/ext/directory, then execute-------------./ext_skel--extname=my_ Module-------------The tool creates a directory with the same name as the module under ext/, and creates some related code. 3 Modify CONFIG.M4 File location:/ext/Module Name/config.m4 Modify method: Remove a few lines related to the module comments (3 lines) (the DNL is removed, optional with,enable, I chose with, because the letter is less: P) 4 Modify the generated code, create a self- Own function This Part how to modify can refer to Zend manual to make own function function I added a function weiping (); Output "Welcome to my homepage:http://www.wmsp.org" detailed instructions in Yorgo Su's article 5 return {PHPSRC} run tool buildconf may sometimes be used buildconf--FO RCE to enforce 6 configure reconfiguration./configure--with-Module Name 7 make no need to say it, just do it. 8 Test Write a test function in your module, then use the newly compiled PHP to perform 9 recompile Apache, add new PHP module libphp4.a Next: PHP module Learning (ii) Zend engine analysis (to be continued) related articles: Config.m4 buildconf
http://www.bkjia.com/PHPjc/531881.html www.bkjia.com true http://www.bkjia.com/PHPjc/531881.html techarticle The original PHP module is also not very difficult to do, where reference to the article is: Write your own php extension function Zend Manual This article is mainly about the compilation Process 1 found PHP source code, ...