Home >Backend Development >PHP Tutorial >Compilation of PHP and Php extensions, and compilation of extension dll files in Windows environment
During the work process, it is necessary to compile the DLL format file of the PHP extension. After a day of tossing, it was finally compiled. The following is an example of compiling the runkit extension under PHP5.3.28. For the official PHP compilation process in the Windows environment, please refer to the following two articles. :
https://wiki.php.net/internals/windows/stepbystepbuild
http://blog.csdn.net/mycwq/article/details/10165955
php5.3.28, compiled by runkit
The process is basically consistent with the documentation. Note that it is recommended to download the latest runkit source code from github, otherwise there is no possibility of compilation errors
runkit:
https://github.com/zenovich/runkit
Compile php in the windows environment The most difficult part is setting up the environment, including vs2008 installation and windows SDK6.1 installation. After the environment is set up
Compilation work
1. Create the compilation directory "C:php_sdk"
2. Unzip the files in php-sdk-binary-tools-20110915.zip to the php_sdk directory
3. In Find and open the Windows SDK CMD Shell on the Start menu (Note it must be the shell of the SDK, not the cmd window for DOS operations), and then execute
[plain] view plaincopy
After execution, the phpdev folder will be generated in the directory
4. Enter C:php_sdkphpdevvc9x86, extract deps-5.3-vc9-x86.7z to the directory, and overwrite the deps folder. (php sdk)
5. Unzip the php source code to the x86 directory.
6. Extract the contents of the runkit compressed package to the ext directory under the decompressed source code of PHP, and change the folder name runkit-master to runkit
7. Create an obj folder in the x86 directory to save the compile time Generated file
8. Execute the following command to create PHP compilation configuration
[plain] view plaincopy
Note: --enable-runkit=shared in the configuration means that memcache is generated in the form of dll, otherwise it is integrated with php .
If you are prompted that bison.exe does not exist, execute the command and then perform the following operations again (After the above configuration, bison.exe should be in the c:php_sdkbin directory. Just put this directory in the environment variable. )
[plain] view plaincopy
9. Compile php and execute the following command
[plain] view plaincopy
10. If you want to package php, execute the following command
[plain] view plaincopy
At this point, the compilation work should be over. php_memcache.dll can be found in the C:php_sdkphpdevvc9x86objReleaseTS directory
The above introduces the compilation of PHP and Php extensions and the compilation of extended dll files in the Windows environment, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.