2016-10-30 12:19:51 +01:00
2016-10-28 14:03:17 +02:00
2016-10-28 16:13:24 +02:00
2016-10-29 22:01:42 +02:00
2016-10-26 01:20:18 +02:00
2016-10-28 02:13:01 +02:00
2016-10-30 12:19:51 +01:00
2016-10-28 02:13:27 +02:00

PHP SDK

PHP SDK is a tool kit for Windows PHP builds

License

The PHP SDK itself and the SDK own tools are licensed under the BSD 2-Clause license. With the usage of the other tools, you accept the respective licenses.

Overview

The PHP SDK 2.0 is compatible with PHP 7.0 and above. The compatibility with older versions, eq. php-sdk-binary-tools-20110915.zip available from windows.php.net previously, is kept. Though, some irrelevant tools was removed. Newer tools are now available, better workflows are now possible. The toolset consists on a mix of the hand written scripts, selected MSYS2 parts and standalone programs.

Requirements

  • Visual C++ 2015 must be installed prior SDK usage
  • if Cygwin is installed, please read notes in the pitfalls section
  • if a 64-bit build is intended, a 64-bit system is required. Cross compilation of 64-bit on 32-bit system is not supported at the moment

Tools

All the tools included are either scripts or 32-bit binaries. They are therefore runable on any of x86 or x64 Windows system.

SDK

  • starter scripts, named phpsdk-<crt>-<arch>.bat
  • phpsdk_buildtree - initialize the development filesystem structure
  • phpsdk_deps - handle dependency libraries
  • phpsdk_version - show SDK version
  • phpsdk_dllmap - create a JSON listing of DLLs contained in zip files

Other tools

  • bison 3.0.2, re2c 0.15.3
  • awk, gawk, sed, grep
  • diff, diff3, patch
  • md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum
  • 7za, zip, unzip, unzipsfx
  • wget

Optional, not included

These are not included with the PHP SDK, but might be useful. While Visual C++ is the only required, the others might enable some additional functionality. Care yourself about making them available on your system, if relevant.

  • Git - useful for PHP source management
  • Cppcheck - used for static analysis
  • clang - useful for experimental builds and for static analysis
  • ICC - useful for experimental builds

Usage

The PHP SDK should be unzipped into the shortest possible path, preferrably into the drive root.

Usually, the first step to start the PHP SDK is by invoking one of the suitable starter scripts. This automatically puts the console on the correct environment relevant for the desired PHP build configuration.

It is not required to hold the source in the PHP SDK directory. It could be useful, for example, to simplify the SDK updates.

Basic usage example

  • git clone https://github.com/OSTC/php-sdk-binary-tools.git c:\php-sdk
  • cd c:\php-sdk
  • git checkout new_binary_tools
  • either run or click on phpsdk-vc14-x64.bat in the PHP SDK root
  • cd to c:\php-sdk and click on phpsdk-vc14-x64.bat in the PHP SDK root
  • phpsdk_buildtree phpmaster
  • git clone https://github.com/php/php-src.git && cd php-src, or fetch a zipball
  • phpsdk_deps --update --branch master
  • do the build, eg. buildconf && configure --enable-cli && nmake

TODO more extensive documentation on the wiki.

The old way

  • git clone https://github.com/OSTC/php-sdk-binary-tools.git c:\php-sdk
  • follow the instructions on the PHP wiki page

Customizing

A sript called phpsdk-local.bat has to be put into the PHP SDK root. If present, it will be automatically picked up by the starter script. A template for such a script is included with the PHP SDK. This allows to setup additional environment.

The starter scripts can be also easy integrated with the consoles other than standard cmd.exe. For the reference, here's an example ConEmu task

C:\php-sdk\phpsdk-vc14-x64.bat -cur_console:d:C:\php-sdk\php70\vc14\x64\php-src

Upgrading

  • backup phpsdk-local.bat
  • backup the source trees, contained in the PHP SDK root
  • move the PHP SDK folder into trash
  • download, unpack and the new PHP SDK version under the same path

Extending

The SDK tools are based on the KISS principle and should be kept so. Basic tools are implemented as simple batch script. The minimalistic PHP is available for internal SDK purposes. It can be used, if more complexity is required. If you have an idea for some useful tool or workflow, please open a ticket or PR, so it can be discussed, implemented and added to the SDK. By contributing an implementation, you should also accept the SDK license.

Pitfalls

  • SDK or PHP sources put into paths including spaces might cause issue.
  • SDK or PHP sources put into too long paths, will cause an issue.
  • If Cygwin is installed, it might cause issues. If it's unavoidable, to have Cygwin on the same machine, ensure SDK preceeds it on the PATH.
  • Tools, based on MSYS2, only accept paths with forward slashes.
Description
No description provided
Readme BSD-2-Clause 129 MiB
Languages
M4 36.8%
C 19.7%
PHP 16.7%
C++ 9.9%
XSLT 7.6%
Other 9.3%