Quickly develop a PHP extension. This article quickly explains how to create a PHP5.2 environment extension (PHPExtension ), I hope that I can help my friends who want to learn more quickly by text. This article explains how to create a PHP 5.2 Environment Extension (PHP 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. in the extension, enter a string in the heiyeluren_test () function, 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.
The Extension of the runtime 5.2 Environment (PHP Extension), hoping to let friends who want to learn quickly learn about production in the form of text...