Skip to content

Latest commit

 

History

History
68 lines (58 loc) · 2.66 KB

WINDOWS.md

File metadata and controls

68 lines (58 loc) · 2.66 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

  • [PHP7 or later] Open the Visual Studio 2015 Command Prompt (Find it by searching for cmd or just open "%VS140COMNTOOLS%\VsDevCmd")
  • [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

Parser troubleshooting

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

Additional Links

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