|
| 1 | +# Zephir Parser |
| 2 | + |
| 3 | +## Installation Guide |
| 4 | + |
| 5 | +This guide explains how to install Zephir Parser using a Windows operating system. |
| 6 | +Some parts are optional, when you have a specific PHP version. |
| 7 | +Parts which are only necessary for a specific PHP version, are marked as such. |
| 8 | +PHP-Version requirements are marked using ``[]`` |
| 9 | + |
| 10 | +### Software Requirements [PHP 5.5 or later] |
| 11 | + |
| 12 | +* [Install Visual Studio 2012 Express](http://www.microsoft.com/en-US/download/details.aspx?id=34673) |
| 13 | +(You should start it and activate it) |
| 14 | + |
| 15 | +### Software Requirements [below PHP 5.5] |
| 16 | + |
| 17 | +* [Install Windows SDK 6.1](http://www.microsoft.com/en-us/download/details.aspx?id=24826) |
| 18 | +**WARNING:** This usually takes very long to install and is very big |
| 19 | +* [Install Visual Studio 2008 Express (after SDK 6.1!)](http://go.microsoft.com/fwlink/?LinkId=104679) |
| 20 | +Install C++ Express Edition, (You should start and activate it) |
| 21 | + |
| 22 | +### Software Requirements General |
| 23 | + |
| 24 | +* [Install PHP (NTS)](http://windows.php.net/download/) |
| 25 | + * Download and extract it |
| 26 | + * Make sure it is in the PATH, as for example below: |
| 27 | + ```cmd |
| 28 | + setx path "%path%;c:\path-to-php\" |
| 29 | + ``` |
| 30 | +* [Install PHP SDK](http://windows.php.net/downloads/php-sdk/) |
| 31 | +(Currently "php-sdk-binary-tools-20110915.zip" is the newest) |
| 32 | +
|
| 33 | +```cmd |
| 34 | +setx php_sdk "c:\path-to-php-sdk" |
| 35 | +``` |
| 36 | + |
| 37 | +* [Download PHP Developer Pack(NTS!)](http://windows.php.net/downloads/releases/) |
| 38 | +(or build it yourself with `--enable-debug --disable-zts` and `nmake build-devel` or just `nmake snap` by using the PHP-SDK) |
| 39 | + |
| 40 | +```cmd |
| 41 | +setx php_devpack "c:\path-to-extracted-devpack" |
| 42 | +``` |
| 43 | + |
| 44 | +### Installation of Zephir Parser |
| 45 | + |
| 46 | +* Clone/Download the repostiory |
| 47 | +* Copy `re2c.exe` to the `parser` folder (from PHP-SDK for example) |
| 48 | +* Go to `parser` directory |
| 49 | +* Next, build `lemon`: |
| 50 | + * PHP 5 |
| 51 | + ```cmd |
| 52 | + cmd /c install-win32-php5.bat |
| 53 | + ``` |
| 54 | + * PHP 7 |
| 55 | + ```cmd |
| 56 | + cmd /c install-win32-php7.bat |
| 57 | + ``` |
| 58 | +
|
| 59 | +* Go to project root and compile Zephir Parser: |
| 60 | +
|
| 61 | +```cmd |
| 62 | +%PHP_DEVPACK%\phpize |
| 63 | +configure --enable-zephir_parser |
| 64 | +nmake 2> compile-errors.log 1> compile.log |
| 65 | +``` |
| 66 | + |
| 67 | +### Parser troubleshooting |
| 68 | + |
| 69 | +* Requirements: Copy `re2c.exe` to the `parser` folder (from PHP-SDK for example) |
| 70 | +* You may have to adjust the paths in buildWin32.bat (if you for example do not use VS2012 on a x64 machine) |
| 71 | + |
| 72 | + |
| 73 | +### Additional Links |
| 74 | + |
| 75 | +Building PHP under Windows: https://wiki.php.net/internals/windows/stepbystepbuild |
0 commit comments