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 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 for PHP 5.6(Currently
php-sdk-binary-tools-20110915.zipis the newest) - Install PHP SDK for PHP 7.0+
setx php_sdk "c:\path-to-php-sdk"- Download PHP Developer Pack(NTS!):php-devel-pack-?.?.?-Win??-VC??-x??.zip
(or build it yourself with
--enable-debug --disable-ztsandnmake build-develor justnmake snapby using the PHP-SDK)
setx php_devpack "c:\path-to-extracted-devpack"- Clone/Download the repository and set the path as below
setx path "%path%;c:\path-to-zephir"
cd c:\path-to-zephir
composer install- Download Zephir Parser for Windows
- Extract the DLL file and copy it to your PHP extensions directory
- Edit your
php.inifile and add this line:[Zephir Parser] ; You can use here absolute path to your custom modules dir ; or relative to the PHP modules dir extension=zephir_parser.dll
NOTE: Also you can compile it yourself.
- [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") - Execute
%PHP_SDK%\bin\phpsdk_setvars CDto your extension andzephir build- Take the built
.dllfromyour_ext/Release/php_extname.dll(oryour_ext/Release_TS/php_extname.dll)
- Building PHP 5.5 - 7.1 under Windows: https://wiki.php.net/internals/windows/stepbystepbuild
- Building PHP 7.2+ under Windows: https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2