PHP extension developed under WINDOW7, window7 development PHP extension
First, see Phpinfo () Information
PHP Version 5.4.34
Zend Extension Build Api220100525,ts,vc9
PHP Extension Build Api20100525,ts,vc9
Thread Safety Enable
Thread Safety, VC9 compilation, 5.4.34 version
Ii. preparatory work before development
PHP 5.3-5.4:visual C + + 9.0 (Visual Studio 2008)
Install Cygwin (download address: http://www.cygwin.com/), Virtual Linux environment
PHP compiled program and pre-compiled source code (download address: http://windows.php.net/download/)
Compiled program path: php-5.4.45-win32-vc9-x86\
Pre-compiled source path: php-5.4.45-src\
Download PHP SDK file, http://windows.php.net/downloads/php-sdk/
1, unzip the php-sdk-binary-tools-20110915.zip inside the file, the Bison.exe is located in the Bin directory to add the system path
Copy Php-5.4.45-win32-vc9-x86\dev\php5ts.lib to Php-5.4.45-src\release_ts\php5ts.lib
Create a new php-5.4.45-src\main\config.win32.h with the following content:
#define Sizeof_long 4
#define PHP_COMPILER_ID "VC9"
"VC9" corresponds to VC9
2, find PHP source directory, php-5.4.45-src\ext\ext_skel_win32.php
1 /* 2 This script can is used on WIN32 systems 3 4 1) Make sure CygWin installed 5 2) Adjust the $cygwin _path to match your Insta Llation 6 3) Change the environment cariable Pathext to include. PHP 7 4) Run Ext_skel--extname= ... 8 The first time you run this script is asked to 9 Associate it with a progra M. chooses the CLI version of PHP. Ten */ One $cygwin _path = ' D:\Program files\cygwin\bin ';
Change this to your Cygwin installation directory.
3, run cmd, enter the PHP source directory, php-5.4.45-src\ext, Run command PHP ext_skel_win32.php--extname=myphpexs
Remember to add the Php.exe directory to path,--extname= your extension name,
If successful, the Myphpexs folder will be generated in the Ext directory, the contents are as follows
4, open MYPHPEXS.DSP with vs2008, solution configuration change to release, execute Build command
Smooth words will generate php_myphpexs.dll files, my will php_myphpexs.dll generated in the PHP source root directory Release_ts folder
5, put Php_myphpexs.dll into your PHP extension directory, and then php.ini add Extension=php_myphpexs.dll
6, the new PHP script file test.php, the content is as follows
1 echo confirm_myphpexs_compiled (' Test ');
7, run the test file, appears the following description, succeeded
congratulations! You have successfully modified EXT/MYPHPEXT/CONFIG.M4. Module compiled to PHP.
8, confirm_myphpexs_compiled is to build an extension is the number of the function, when you edit your own extension content, you can delete the change function
http://www.bkjia.com/PHPjc/1086506.html www.bkjia.com true http://www.bkjia.com/PHPjc/1086506.html techarticle Window7 Development PHP extension, window7 development php extension One, first view phpinfo () information php Version 5.4.34 Zend Extension Build api220100525,ts,vc9 PHP Ext Ension Build api20100525,t ...