: 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
- The setenv/x86/xp/release // statement must be successfully executed. Otherwise, the compilation will fail.
- Cd php_sdk
- Bin \ phpsdk_setvars.bat
- 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
- Cd phpdev \ vc9 \ x86 \ php5.3-201308211030
- Buildconf
- Configure -- help> .. \ configure_help.txt
- 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
- Set path = % path %; C: \ php_sdk \ bin
9. compile php and execute the following command:
[Plain] view plaincopy
- Nmake
10. if you want to package php, run the following command:
[Plain] view plaincopy
- 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.