PHP7 was released, but how do I compile it?

Source: Internet
Author: User
Tags vc9 zts
How do I compile the latest published PHP on Windows?

Reply content:

How do I compile the latest published PHP on Windows?

To compile and install the PHP tutorial on Windows, see:
Https://wiki.php.net/internals/windows/stepbystepbuild
Take 5.4 As an example:
PHP 5.4 (source code + dependent Library +SDK tool) + Visual Studio + 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 you start Windows SDK 6.1 Setup, you need to download 1.2G of data and 3GB of disk space)
Http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso English version
Http://download.microsoft.com/download/3/0/2/3025EAE6-2E15-4972-972A-F5B1ED248E85/VS2008ExpressWithSP1CHSX1504735.iso Chinese Version
Watch the order! Install Windows SDK 6.1 and its service packs and security updates First,
Then install visual Studio Express Edition SP1 (Run Setup.hta, choose Install Visual C + + 2008).

Start Menu Open Windows SDK v6.1 CMD Shell Execution setenv/x86/xp/release
Create the directory C:\php-sdk and extract the Php-sdk-binary-tools to this directory.
CD C:\php-sdk\
Bin\phpsdk_buildtree.bat Phpdev
Extract the PHP source code to C:\php-sdk\phpdev\vc9\x86, such as:
C:\php-sdk\phpdev\vc9\x86\php-5.4.45-src
Unzip the deps-5.4-vc9-x86.7z to
C:\php-sdk\phpdev\vc9\x86\deps
To start compiling:
CD C:\php-sdk\
Bin\phpsdk_setvars.bat (Set environment variable, otherwise configure will be prompted to find tools such as bison)
CD C:\PHP-SDK\PHPDEV\VC9\X86\PHP-5.4.45-SRC
Buildconf
If an input error occurs: There is no file extension ". js" for the scripting engine.
Regedit changes the default value under [Hkey_classes_root\.js] to Jsfile
Re-executing the buildconf can generate configure.js.
Configure--help
Configure--disable-zts--disable-all--ENABLE-CLI
Performs NMAKE compilation, and the compiled binaries are located at:
C:\php-sdk\phpdev\vc9\x86\php-5.4.45-src\Release
Run NMAKE Snap package:
C:\php-sdk\phpdev\vc9\x86\php-5.4.45-src\Release\php-5.4.45-nts-Win32-VC9-x86.zip
Recompile:
NMAKE clean clears the old binary file
RD/S/q Release
buildconf--force generate a new Configure.js script
Configure--disable-zts--disable-all--ENABLE-CLI
Nmake

Unzip-to-use, PHP7 packaging across Linux distributions (with compiled packaging method)

Https://wiki.php.net/phpng

#安装编译PHP依赖的开发工具和库: 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_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 \--with-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# Compiling and installing make && make install

The official website has not yet provided a compiled version, and the current source code can not be downloaded to support Windows, but the PHP source code library has the content of Windows compilation.
Send an address, the official compiled DLL address, is currently the latest version of 7.0 RC8
http://windows.php.net/qa/

If it's a Linux build environment or Mac OS x environment, you can refer to my article http://segmentfault.com/a/1190000004065931

  • 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.