Quickly develop a PHP extension this article explains how to create a PHP5.2 environment extension in a very fast way ), I hope that the production process can be understood by anyone who wants to learn quickly in the form of text and text. Requirement: for example, develop an extension called heiyeluren, input a string in the extension function heiyeluren_test (), and return the function to quickly develop a PHP extension.
This article explains how to create a PHP 5.2 Environment Extension (PHP Extension) in a very fast way. I hope that you can learn about the production process in a graphic way.
Requirements:For example, if you develop an extension called heiyeluren, input a string using the heiyeluren_test () function in the extension, and the function returns: Your input string: xxxxx.
Requirements:Understand C/C ++ programming and be familiar with PHP programming
Environment:Download a php corresponding version of the source code, I here is the php-5.2.6, the first normal installation of php, assuming that our php installed in the/usr/local/php Directory, source code in/root/soft/php/php-5.2.6/, now start!
Step 1: generate an extension framework
CDS/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
After opening the file, remove dnl and obtain the following information:
PHP_ARG_ENABLE (heiyeluren, whether to enable heiyeluren support,
[-- Enable-heiyeluren Enable heiyeluren support])
Save and exit.
Beautiful and bright seven fairies
02:15