PHP5 Custom Module Development

Source: Internet
Author: User

This article needs to be used in the previous article, but it needs to be compiled into the form of a dynamic or static link library. In this article, you rename main () in the WebService client program to Testphpmodule () and return the string that is printed to the console, and the build file name is libtest.so when the compilation is complete.

I. Environmental preparedness

Copy the generated libtest.so file to the/usr/lib directory and execute the command/sbin/ldconfig

Prepare the PHP source code file and unzip it.

Second, the development of PHP Module

First into the PHP source code directory in the EXT directory, to execute the following command:

#./ext_skel--extname= Custom Module name

When the execution is complete, a folder named "Custom module name" is generated and the Config.m4 file is edited after entering this folder

Locate the following code:

dnl PHP_ARG_WITH(Test, for Test support,
dnl Make sure that the comment is aligned:
dnl [  --with-Test             Include Test support])

Or

dnl PHP_ARG_ENABLE(Test, whether to enable Test support,
dnl Make sure that the comment is aligned:
dnl [  --enable-Test           Enable Test support])

Remove the DNL in front of each line

If you want to pass a dynamic reference, suggest using--enable-test

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.