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 []
- Install Visual Studio 2012 Express (You should start it and activate it)
- Install Windows SDK 6.1 WARNING: This usually takes very long to install and is very big
- Install Visual Studio 2008 Express (after SDK 6.1!) Install C++ Express Edition, (You should start and activate it)
- 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"
- Download PHP Developer Pack(NTS!)
(or build it yourself with
--enable-debug --disable-zts
andnmake build-devel
or justnmake snap
by using the PHP-SDK)
setx php_devpack "c:\path-to-extracted-devpack"
- Clone/Download the repostiory and set the path as below
setx path "%path%;c:\path-to-zephir\bin"
- [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 andzephir build
- Take the built
.dll
fromyour_ext/Release/php_extname.dll
- 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)
Building PHP under Windows: https://wiki.php.net/internals/windows/stepbystepbuild