Author: Binzy Wu Source: Beyond PHP 1. Expand your php2 extension of three ways 3. Extend the extension dll way 4. Summary First note that all of the following are all carried out in the win, the tools used vc 6.0. Extend your phpphp to quickly and quickly quickly account for an important role in Web system development. PHP itself provides a lot of functions and features. Long-term short saying. Let's see how we expand. Extended 3 ways External The advantages and disadvantages of ModulesBuilt-in ModulesThe Zend Engine can see the PHP manual.http://www.php.net/manual/en/zed.possibilities.phpextension dll1. First we go to the next PHP Source. You can see The following important directories .ext, main, tsrm, zend, and we may also need bindlib_w32 (you need you from cvs up and down), and PHP4TS.LIB2 under the PHP directory. Open VC, create a new Win32 Dynamic-Link Library, as follows Figure 3. Point OK, select 'An Empty DLL Project', And Click Finish.4. Setting Release:) 5. Project-> settings. Predefined ID. The whole is. Zend_debug = 0, compile_dl_binzy, ZTS = 1, Zend_WIN32, PHP_WIN32, Have_binzy = 1 This is a path that can be added. Several paths mentioned above can be added. Select Multithreaded DLL, when you are named, you want to link php4tsts.lib ~~:) O, forget Don't forget to add / TC parameters. 6. Write code. Building a head, build a body. Binzy.h // binzy wu // 2004-4-9 // PHP EXTENSION #IF HAVE_BINZY EXTERN ZEND_MODULE_ENTRY BINZY_MODULE_ENTRY; # DEFINE BINZY_MODULE_PTR & BINZY_MODULE_ENTRY PHP_FUNCTION (HELLOBINZY); // php_minfo_function (binzy); // #ndifbinz Yc // binzy wu // 2004-4-9 // php extension #include "php.h" #include "binzy.h" #if Have_binzy #if compile_dl_binzy zend_get_module (binzy) #ENDIF FUNCTION_ENTRY BINZY_FUNCTIONS [] = {php_fe ( hellobinzy, NULL) {NULL, NULL, NULL}}; zend_module_entry binzy_module_entry = {STANDARD_MODULE_HEADER, "binzy", binzy_functions, NULL, NULL, NULL, NULL, PHP_MINFO (binzy), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES}; PHP_MINFO_FUNCTION (binzy) {php_info_print_table_start ( ); php_info_print_table_row (2, "binzy extension", "enable"); php_info_print_table_end ();} php_function (hellobinzy) {zend_printf ("Hello Binzy");