PHP C extension development

PHP C extension development

Students who are interested in the development of PHP C extensions can take a look. The project contains 8 demos, each of which can be extracted and run independently. Compared with the skeleton generated by ext_skel, the demo will be better understood (only the core methods are included). Each demo has a corresponding test file and running document, and there will be more detailed comments in the code.

Requirement

PHP 5.2 +

Install

Linux compile and install

$/$path/phpize
$ ./configure
$ make && make install
$// gglinux.so   php.ini 

Document

demo1 : extended development-basic structure

demo2 : extended development-independent function

demo3 : Extended development-use return value

demo4 : Extended development-get function parameters

demo5 : Extended development-HashTable use

demo6 : Extended development-Array use

demo7 : Extended development-resource usage

demo8 : Extended development-use of global variables (thread-safe resource management macros)

More

PHP extension development and kernel application

Extend your PHP with C/C++

In-depth understanding of the PHP core