Detailed Window7 development PHP extension, detailed window7php extension _php tutorial

Source: Internet
Author: User
Tags vc9

Detailed Window7 development PHP extension, detailed window7php 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

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

Copy the Code code as follows:
echo confirm_myphpexs_compiled (' Test ');

7, run the test file, appears the following description, succeeded

Copy the Code code as follows:
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

Articles you may be interested in:

    • Methods for developing and compiling PHP extensions under Windows
    • Imagick and ImageMagick extension tutorials for installing PHP under Windows7
    • PHP-SSH2 extension Tutorial for installing PHP under Windows7
    • How to open php Curl extension in Windows R2 64-bit server
    • Configuring the php5.5 development environment and development extensions under Windows

http://www.bkjia.com/PHPjc/1087277.html www.bkjia.com true http://www.bkjia.com/PHPjc/1087277.html techarticle detailed Window7 development php extension, detailed window7php extension one, first view phpinfo () information php Version 5.4.34 Zend Extension Build api220100525,ts,vc9 PHP E XTension Build API2010 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.