1. Download PHP5.4.27 Source code
2. Download php-5.4.27-win32-vc9-x86
3. Put them in the same directory, such as the Php_win_ext directory
4. Copy the src/win32/build/config.w32.h.in file from source to src/main/, and rename it as: Config.w32.h.
5. Create the WIN32 DLL project and empty the project. Remember to attach the LIB to the project, include the directory, some macro definitions (ZEND WIN32 must be php_win32 zend_win32, etc., specifically refer to the ZEND development documentation).
6. In the source code, you need to specify the version number of the compilation: #define PHP_COMPILER_ID "VC9"
Note: You need to download the thread-safe version of PHP because the plugin I'm developing is the WIN32 interface engine, which requires thread safety.
5.4 Using VC9, also known as VS2008, can be created manually without creating skeleton code.
Below the online copy of a code, I compiled, normal display
/** * Sample code **/#definephp_compiler_id "VC9"#include"Php.h"#include"ext/standard/info.h"Zend_function (example); Php_minfo_function (example); Zend_function_entry use_functions[]={Zend_fe (example, null) {NULL, NULL, NULL}}; Zend_module_entry example_module_entry={standard_module_header,"PHP Extension Example", use_functions, NULL, NULL, NULL, NULL, Php_minfo (example),"1.0 Beta", standard_module_properties}; Zend_get_module (example); Zend_function (example) {BOOLparam; if(Zend_parse_parameters (Zend_num_args () TSRMLS_CC,"|b", ¶m) = =FAILURE) {e_error; return; } if(param) {php_printf ("Example Parm is true"); } Else{php_printf ("Example Parm is False"); } return;} Php_minfo_function (example) {Php_info_print_table_start (); Php_info_print_table_header (2,"PHP Extension Example Support","enabled"); Php_info_print_table_row (2,"Version","1.0 Beta"); Php_info_print_table_end ();}
<? Echo Example (true); // output: Example Parm is true ?>
Remember that in the php.ini add this plugin, after the successful compilation, that is, the introduction has been introduced, you can slowly add other function extension functions.