Win under the PHP extension VC6 compilation

Source: Internet
Author: User

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



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.