One of the php modules

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.