jimthunderbird / php-to-c-extension

127 stars 28 forks source link

Install Failed #16

Open renlight10 opened 7 years ago

renlight10 commented 7 years ago

hi tried to clone this repo then run composer install and follow example php build_extensions.php Dummy.php but there a error

Installing zephir...
You need to run this command from the top level of the working tree.
sh: autogen.sh: No such file or directory
./install-json: line 5: ./configure: No such fie or directory
make: *** No targets specified and no makefile found.  Stop.
./install: line 11: re2c: command not found
error: re2c is not installed
Error: PHP Parser Error: Syntax error, unexpected '<', expecting T_STRING on line 3
sergeyklay commented 7 years ago

re2c is not installed

Yo have to install re2c

renlight10 commented 7 years ago

@sergeyklay thanks for notice :) , several error still append like this https://gitlab.com/renlight10/phpc/builds/8745147

sergeyklay commented 7 years ago

Can't exec "aclocal": No such file or directory

sudo apt-get install automake

jimthunderbird commented 7 years ago

Try installing automate and the issue should be solved.

jimthunderbird commented 7 years ago

Oops I mean automake:)

renlight10 commented 7 years ago

thanks, automake resolve aclocal but build keep failed https://gitlab.com/renlight10/phpc/builds/8765516

is there any missing dependency in ci ?

# Select image from https://hub.docker.com/_/php/
image: php:5.6

before_script:
# Install git, the php image doesn't have installed
- apt-get update -yqq
- apt-get install sudo -yqq
- apt-get install zip -yqq
- apt-get install unzip -yqq
- apt-get install automake -yqq
- apt-get install git -yqq
- apt-get install build-essential -yqq
- apt-get install re2c -yqq
- apt-get install libpcre3-dev -yqq

# Install composer
- curl -sS https://getcomposer.org/installer | php

# Install all project dependencies
- php composer.phar install

test:
  script:
  - php build_extensions.php Dummy.php
  - php -dextension=dummy.so test.php
jimthunderbird commented 7 years ago

Did php install properly?

sergeyklay commented 7 years ago

To install Zephir, please follow these steps: https://docs.zephir-lang.com/en/latest/install.html#prerequisites

LucasMali commented 7 years ago

Getting the same error:

Lucass-MBP:PHP lucasmaliszewski$ brew install re2c
Warning: re2c 1.0.1 is already installed
Lucass-MBP:PHP lucasmaliszewski$ php php-to-c-extension/build_extensions.php Project/
Installing zephir...
**sh: autogen.sh: No such file or directory**
./install-json: line 5: ./configure: No such file or directory
make: *** No targets specified and no makefile found.  Stop.
error: re2c is not installed
Error: PHP Parser Error: Syntax error, unexpected '<', expecting T_STRING on line 3
Lucass-MBP:PHP lucasmaliszewski$ 

Also:

Lucass-MBP:PHP lucasmaliszewski$ brew install automake
Warning: automake 1.15.1 is already installed
Lucass-MBP:PHP lucasmaliszewski$ brew install make
Warning: make 4.2.1_1 is already installed
Lucass-MBP:PHP lucasmaliszewski$ 

And:

Lucass-MBP:PHP lucasmaliszewski$ zephir help

 _____              __    _
/__  /  ___  ____  / /_  (_)____
  / /  / _ \/ __ \/ __ \/ / ___/
 / /__/  __/ /_/ / / / / / /
/____/\___/ .___/_/ /_/_/_/
         /_/

Zephir version 0.9.11-534bd284df

Usage: 
    command [options] ...
Stevehans commented 6 years ago

json-c is empty, need to clone into it, but you'll then have further errors. git clone https://github.com/json-c/json-c.git

sergeyklay commented 6 years ago

@LucasMaliszewski

Warning: re2c 1.0.1 is already installed

Note: In most cases Zephir does not work (still) with re2c 1.x

Muqsit commented 6 years ago

It's due to this commit: https://github.com/phalcon/zephir/commit/a0a973c81bd1f6079c58df79eb6aeb2279647d5d

Add git clone https://github.com/phalcon/json-c just before git submodule update --init in vendor/phalcon/zephir/install-json.