Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zephir on Windows 64 Php 7 #1377

Closed
joseph-montanez opened this issue Dec 30, 2016 · 2 comments
Closed

Zephir on Windows 64 Php 7 #1377

joseph-montanez opened this issue Dec 30, 2016 · 2 comments

Comments

@joseph-montanez
Copy link

joseph-montanez commented Dec 30, 2016

I've just been shaving the yak here trying to get Zephir working on windows.

I went ahead and follow this guide. However, I ran into a few snags
https://github.com/phalcon/zephir/blob/master/WINDOWS.md

  1. re2c.exe - It doesn't say what version, I downloaded it from gnuwin32 because nothing on my system had that executable. Apparently, it was too old (compile errors converting the .re files into .c) and I needed up putting it in zephir\bin. I ended removing re2c.exe from zephir\bin and instead installed https://chocolatey.org (as admin), and then ran "choco install re2c". That version worked correctly.
  2. bison.exe - nothing about bison, also downloaded from gnuwin32 that seemed to work when I placed it in zephir\bin

Then came the build errors and I saw PHP 5 extensions referenced, when I had setup PHP 7 sdk and devpack. So i've edited zephir\parser\parser\build_win32.bat and switched:

REM Build Lemon
cl lemon.c
del parser.c parser.h scanner.c
re2c -o scanner.c scanner.re
lemon -s parser.php5.lemon
type parser.php5.c > parser.c
type base.c >> parser.c

to

REM Build Lemon
cl lemon.c
del parser.c parser.h scanner.c
re2c -o scanner.c scanner.re
lemon -s parser.php7.lemon
type parser.php7.c > parser.c
type base.c >> parser.c

Of course these files are generated on the fly so if it was to configure the parser again then that file would revert. BTW There was an issue opened on this and then closed: #1366

And while I did finally get php_zephir_parser.dll, it was in the wrong path. So I found a Japanese blog entry about a simular issue with Windows x64, and pointed to zephir\Library\Compiler.php, and after line 250, $buildType needed to be prefixed with 'x64/'. The if statement in the blog didn't work, so I just hard coded in the prefix:

$buildType = 'x64/' . $buildType;

And that seemed to work! I could now run:
php -dextension=ext\x64\Release_TS\php_utils.dll -r "echo Utils\Greeting::say(), "\n";"

The overall issues

  • documentation for rec2.exe and bison.exe versions and where do we get these files they don't come with php 7, sdk, or devpack
  • Something is wrong with PHP 7 detection, maybe just on windows, not sure why zephir\parser\parser\build_win32.bat was using php5
  • While I needed to edit zephir\Library\Compiler.php I don't think that's an appropriate solution, the problem is in the build process, it should copy the dll to the correct folder.
@mahmoud-eskandari
Copy link

mahmoud-eskandari commented Apr 6, 2017

I installed all dependencies attention to
https://github.com/phalcon/zephir/blob/master/WINDOWS.md

F:\mnbox>zephir build
Preparing for PHP compilation...
Preparing configuration file...
Compiling...
Installation is not implemented for windows yet! Aborting!

When i try to zephir build
the ext/configure.js
opening in visual studio...

is a video for Zephir Windows Installing and Building ?

@sergeyklay
Copy link
Member

@joseph-montanez @mahmoud-eskandari

We created a separated repository with precompiled DLLs.

Please check the mentioned repository and re-open this if you continue experiencing problems using Zephir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants