1. Download the PHP source package Cygwin preparation work
Http://cn.php.net/get/php-5.2.6.tar.gz/from/a/mirror
Http://www.cygwin.cn/setup.exe
2.
Modify
php-5.2.6/ext/ext_skel_win32.php
In the file
$cygwin _path = ' e:/ggg/cygwin/bin '; This corresponds to your Cygwin directory.
3.
Run in php-5.2.6/ext/directory
PHP ext_skel_win32.php--extname=test
To create an extension named Test
4.
Find the Php5ts.lib file from the/dev/in your PHP binary package, copy it to the directory where your project package is located, copy 2 copies, one named Php5ts.lib, and the other named Php5ts_debug.lib.
For the present is placed in the php-5.2.6/ext/test/directory
5.
Open EXT/TEST/TEST.DSP file with VC6
Set up. Project->settings->c/c++->preprocessor definitions
Change the zend_debug=1 here to zend_debug=0.
6.
Php_test.dll files can be found in Php-5.2.6/debug_ts after compilation
Add in PHP.ini
Extension=php_test.dll
After you start Apache again
Run./php ext/test/test.php
Can see
Functions available in the test extension:
Confirm_test_compiled
congratulations! You have successfully modified EXT/TEST/CONFIG.M4. Module Test
is now compiled into PHP.
Success!
* Note
The PHP environment that does not rely on Apache can directly
Ini
Php.exe
Php5ts.dll
These three files are placed in a folder such as Php_ggg
Then put the ext/test/test.php and the compiled Test.dll in the PHP_GGG directory.
Run in the PHP_GGG directory./php test.php can