On windows, how does one compile the latest php version? On windows, how does one compile the latest php version?
Reply content:
On windows, how does one compile the latest php version?
For details about how to compile and install PHP on Windows, refer:
Https://wiki.php.net/internals/windows/stepbystepbuild
Take 5.4 as an example:
PHP 5.4 (source code + dependent libraries + SDK tools) + Visual Studio 2008 + Windows SDK 6.1
Http://windows.php.net/downloads/releases/php-5.4.45-src.zip
Http://windows.php.net/downloads/php-sdk/deps-5.4-vc9-x86.7z
Http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip
Https://www.microsoft.com/en-us/download/details.aspx? Id = 11310 (after the Windows SDK 6.1 installation program is started, you need to download GB of data and 3 GB of disk space)
Http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso
Http://download.microsoft.com/download/3/0/2/3025EAE6-2E15-4972-972A-F5B1ED248E85/VS2008ExpressWithSP1CHSX1504735.iso
Attention order! First install Windows SDK 6.1 and its service packs and security updates,
Then install Visual Studio 2008 Express Edition SP1 (run Setup. hta and select install Visual C ++ 2008 ).
Start Menu open Windows SDK v6.1 CMD shell run setenv/x86/xp/release
Create the directory C: \ php-sdk and decompress php-sdk-binary-tools to this directory.
Cd C: \ php-sdk \
Bin \ phpsdk_buildtree.bat phpdev
Decompress the PHP source code to C: \ php-sdk \ phpdev \ vc9 \ x86, for example:
C: \ php-sdk \ phpdev \ vc9 \ x86 \ php-5.4.45-src.
Decompress deps-5.4-vc9-x86.7z
C: \ php-sdk \ phpdev \ vc9 \ x86 \ deps
Start Compilation:
Cd C: \ php-sdk \
Bin \ phpsdk_setvars.bat (set environment variables; otherwise, tools such as bison cannot be found in configure)
Cd C: \ php-sdk \ phpdev \ vc9 \ x86 \ php-5.4.45-src
Buildconf
If an input error occurs: No file extension ". js" Script Engine is available.
Regedit: Change the default value under [HKEY_CLASSES_ROOT \. js] To JSFile.
Execute buildconf again to generate configure. js.
Configure -- help
Configure -- disable-zts -- disable-all -- enable-cli
Execute nmake compilation. The binary file generated after compilation is located:
C: \ php-sdk \ phpdev \ vc9 \ x86 \ php-5.4.45-src \ Release
Run nmake snap to package:
C: \ php-sdk \ phpdev \ vc9 \ x86 \ php-5.4.45-src \ Release \ php-5.4.45-nts-Win32-VC9-x86.zip
Re-compile:
Nmake clean clears old binary files
Rd/s/q Release
Buildconf -- force generates a new configure. js script
Configure -- disable-zts -- disable-all -- enable-cli
Nmake
Decompress the package and package PHP 7 Across Linux releases (with the compilation and packaging method included)
Https://wiki.php.net/phpng
# Install and compile the development tools and libraries on which PHP depends: sudo apt-get install \ build-essential \ autoconf \ libtool \ re2c \ libxml2-dev \ openssl \ libcurl4-openssl-dev \ libbz2-dev \ libjpeg-dev \ libpng12-dev \ libfreetype6-dev \ libldap2-dev \ libmcrypt-dev \ libmysqlclient- dev \ libxslt1-dev \ libxt-dev \ libpcre3-dev \ libxpm-dev \ libt1-dev \ libgmp-dev \ libpspell-dev \ librecode-dev \ libreadline6-dev # configure script configure_php.sh #! /Bin/bash. /configure \ -- prefix =/png/php/7.0.0 \ -- enable-opcache \ -- enable-fpm \ -- enable-pdo \ -- enable-sockets \ -- enable-exif \ -- enable -soap \ -- enable-ftp \ -- enable-wddx \ -- enable-pcntl \ -- enable-soap \ -- enable-bcmath \ -- enable-mbstring \ -- enable-dba \ -- enable -gd-native-ttf \ -- enable-gd-jis-conv \ -- enable-zip \ -- enable-calendar \ -- enable-shmop \ -- enable-sysvmsg \ -- enable-sysvsem \ -- enable-sysvshm \ -- with-mysqli \ -- with-pdo-mysql \ -- with-pdo-sqlite \ -- with-iconv \ -- with-gmp \ -- with-pspell \ -- with-xmlrpc \ -- with-openssl \ -- with-mhash \ -- with-mcrypt \ -- with-xsl \ -- with-curl \ -- with-pcre-regex \ --- gd \ -- with-jpeg-dir =/usr \ -- with-png-dir =/usr \ -- with-zlib-dir =/usr \ -- with-xpm-dir =/ usr \ -- with-freetype-dir =/usr \ -- with-gettext =/usr \ -- with-zlib =/usr \ -- with-bz2 =/usr \ -- with-recode =/ usr \ -- with-ldap \ -- with-pear \ -- with-readline \ -- with-fpm-user = png \ -- with-fpm-group = png \ -- with-apxs2 =/png /httpd/2.4.17/bin/apxs # compile and install make & make install
The official website does not provide a compiled version yet. Currently, the official source code that can be downloaded does not support Windows, but the PHP source code library contains Windows compiling content.
Here is an official DLL address. The latest version is 7.0 RC8.
Http://windows.php.net/qa/
For Linux compiling environment or Mac OS X environment, refer to my article http://segmentfault.com/a/1190000004065931