Use ext_skel to develop extensions for php | to be updated

Source: Internet
Author: User
Use ext_skel for php Development extension | to be more ext_skel is a development and generation tool included in the php source code package

You can use C ++ to compile available. so libraries and add functions to extend php functions.

First download the source code from the official website

Decompress it with tar-zxvf

First, we need to create a xxx. skel file, which contains the declaration of the extended function to be defined.

For example, 'string bingo (string str)

Go to the ext Directory of the php source code package.

Use commands

./ext_skel --extname=bingo --proto=/home/bingo.skel

Generate a framework package and modify the config. m4 file.

Comment out PHP_ARG_WITH or PHP_ARG_ENABLE (choose one based on the actual situation. The first one is that the extension requires the support of a third-party library ).

Modify the phpext. c file to comment out the default function and compile our bingo function.

Use phpize to create a configuration and run it in phpext:

/opt/lampp/bin/phpize./configure --with-php-config=/opt/lampp/bin/php-config

And install

makemake testmake install clean

# The following steps cannot be performed due to various strange reasons of kali. you can check them again next time.

In the/xxx/php/folder, an additional file named binso. so will be added.

Locate php. ini or extensions. ini and add a line to it.

extension=bingo.so

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.