Home >Backend Development >PHP Tutorial >Quickly develop a PHP extension_PHP tutorial

Quickly develop a PHP extension_PHP tutorial

WBOY
WBOYOriginal
2016-07-14 10:08:40962browse

This article explains how to make a PHP 5.2 environment extension (PHP Extension) in a very quick way. I hope that friends who want to learn quickly can understand the production process through pictures and texts.

Requirement: For example, develop an extension called heiyeluren. There is a function heiyeluren_test() in the extension. Input a string and the function returns: Your input string: xxxxx.
Requirements: Understand C/C++ programming and be familiar with PHP programming
Environment: Download a copy of the source code of the corresponding version of php. Here is php-5.2.6. Install php normally first. Assume that our php is installed in the /usr/local/php directory and the source code is in /root/soft/php /php-5.2.6/, start now!
Step 1: Generate extension framework
cd /root/soft/php/php-5.2.6/ext
./ext_skel --extname=heiyeluren
cd /root/soft/php/php-5.2.6/ext/heiyeluren
vi config.m4
Remove dnl after opening the file and get the following information:
PHP_ARG_ENABLE(heiyeluren, whether to enable heiyeluren support,
[ --enable-heiyeluren           Enable heiyeluren support])
Save and exit.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477755.htmlTechArticleThis article explains how to make a PHP 5.2 environment extension (PHP Extension) in a very fast way. I hope it can be used in Let friends who want to learn quickly understand the production in the form of pictures and texts...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn