Extension compilation of php and Php in windows, extension of dll file compilation

Source: Internet
Author: User
Tags runkit vc9
: This article mainly introduces php and Php extension compilation and extension dll file compilation in windows. For more information about PHP tutorials, see. During the working process, the dll format file of php extension needs to be compiled. after one day of hard work, it is finally compiled. the following uses compiling the runkit extension under php5.3.28 as an example, for the official php compilation process in windows, refer to the following two articles:

Https://wiki.php.net/internals/windows/stepbystepbuild

Http://blog.csdn.net/mycwq/article/details/10165955

Php5.3.28, runkit

The compilation process is basically the same as that in the document. Note that we recommend that you download the latest runkit source code from github. otherwise, compilation errors may occur.

Runkit:

Https://github.com/zenovich/runkit

In windows, the most difficult part to compile php is to build the environment, including vs2008 installation and windows SDK6.1 installation. After the environment is set up

Compilation

1. create the compilation directory "C: \ php_sdk"

2. decompress the php-sdk-binary-tools-20151115.zip file to the php_sdk directory.

3. find and open the Windows sdk cmd Shell in the Start menu (note that it must be the SDK shell, not the DOS cmd window), and then execute

[Plain] view plaincopy

  1. The setenv/x86/xp/release // statement must be successfully executed. Otherwise, the compilation will fail.
  2. Cd php_sdk
  3. Bin \ phpsdk_setvars.bat
  4. Bin \ phpsdk_buildtree.bat phpdev

After the command is executed, the phpdev folder is generated under the Directory.

4. go to C: \ php_sdk \ phpdev \ vc9 \ x86 \, decompress deps-5.3-vc9-x86.7z to this directory, and overwrite the deps folder. (Php sdk)

5. decompress the php source code to the x86 directory.

6. decompress the content of the runkit package to the ext Directory of the php decompressed source code, and change the folder name runkit-master to runkit.

7. create an obj folder in the x86 directory to save the files generated during compilation.

8. run the following command to create the php compilation configuration.

[Plain] view plaincopy

  1. Cd phpdev \ vc9 \ x86 \ php5.3-201308211030
  2. Buildconf
  3. Configure -- help> .. \ configure_help.txt
  4. Configure -- disable-all -- enable-cli -- enable-runkit = shared -- enable-object-out-dir = .. \ obj

Note: in the configuration, -- enable-runkit = shared indicates that memcache is generated as dll; otherwise, it is integrated with php.

If bison.exedoes not exist, execute the command and re-execute the next operation (after the configuration is completed, bison.exe should put the directory in the environment variable directory under c: \ php_sdk \ bin)

[Plain] view plaincopy

  1. Set path = % path %; C: \ php_sdk \ bin

9. compile php and execute the following command:

[Plain] view plaincopy

  1. Nmake

10. if you want to package php, run the following command:

[Plain] view plaincopy

  1. Nmake snap

At this point, the compilation should be over. You can find php_memcache.dll in the C: \ php_sdk \ phpdev \ vc9 \ x86 \ obj \ ReleaseTS \ directory.


The above describes php and Php extension compilation and dll extension file compilation in windows, including some content, and hope to help friends who are interested in PHP tutorials.

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.