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.


PHP 5.2 +


Linux compile and install

$ ./configure
$ make && make install
$//   php.ini 


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)


PHP extension development and kernel application

Extend your PHP with C/C++

In-depth understanding of the PHP core