It was not very difficult to write a php module. The reference articles include: compile your own php Extension function zend manual. This article mainly describes the compilation process 1. Find the php source code, decompress (if you have already installed the original installation source code) 2. Use the tool "ext_skel" to initialize the module code. This tool has prepared some necessary code for you. tool location:/ext/ext_skel usage: ext_skel -- extname = Module name first enters the/ext/directory, and then runs -------------. /ext_skel -- extname = my_module ------------- this tool will create a directory with the same name as the module in ext/and create some relevant code. 3. Modify config. m4 File Location:/ext/Module name/config. m4 modification method: remove several comments related to the module (3 lines) (remove dnl, optional with, enable, I chose with, because fewer letters: P) 4. Modify the generated code and create your own function. For details about how to modify this part, refer to zend manual to create your own function. I added a function weiping () and output "welcome to my homepage: http://www.wmsp.org "specific practices in Yorgo Su article has detailed description 5 return {phpsrc} Run tool buildconf sometimes may use buildconf -- force to force 6 configure reconfiguration. /configure -- with-Module name 7 make doesn't need to be said much. Just press make to test and write a test function in your module, and then execute 9 with the compiled php to re-compile apache, add the new php module libphp4.a next article: php module Learning (ii) zend engine analysis (to be continued) related articles: config. m4 buildconf