Skip to content

Latest commit

 

History

History
69 lines (59 loc) · 2.73 KB

WINDOWS.md

File metadata and controls

69 lines (59 loc) · 2.73 KB

Zephir Installation/Usage Guide (Windows)

This guide explains how to use zephir using a windows operating system.
Some parts are optional, when you have a specific PHP version.
Parts which are only necessary for a specific PHP version, are marked as such.
PHP-Version requirements are marked using []

Software Requirements [PHP 5.5 or later]

Software Requirements [below PHP 5.5]

Software Requirements General

  • Install PHP (NTS)
    • Download and extract it
    • Make sure it is in the PATH, as for example below:
    setx path "%path%;c:\path-to-php\"
    
  • Install PHP SDK
    (Currently "php-sdk-binary-tools-20110915.zip" is the newest)
setx php_sdk "c:\path-to-php-sdk"
setx php_devpack "c:\path-to-extracted-devpack"

Installation of Zephir

  • Clone/Download the repostiory and set the path as below
setx path "%path%;c:\path-to-zephir\bin"

Usage of Zephir

  • [PHP5.5 or later] Open the Visual Studio 2012 Command Prompt
    (Find it by searching for cmd or just open "%VS110COMNTOOLS%\VsDevCmd")
  • [below PHP5.5] Open the Visual Studio 2008 Command Prompt
    (Find it by search for cmd or just open "%VS90COMNTOOLS%\vsvars32")
  • Execute %PHP_SDK%\bin\phpsdk_setvars
  • CD to your extension and zephir build
  • Take the built .dll from your_ext/Release/php_extname.dll

Building the parser

  • Build zephir/json-c using VS2012 and copy the resulting json-c.lib (static library) to the parser directory
  • Requirements: Copy re2c.exe to the parser folder (from PHP-SDK for example)
  • You may have to adjust the paths in buildWin32.bat (if you for example do not use VS2012 on a x64 machine)
  • Run parser/buildWin32.bat to build the parser.exe

Additional Links

Building PHP under Windows: https://wiki.php.net/internals/windows/stepbystepbuild