php-to-c-extension icon indicating copy to clipboard operation
php-to-c-extension copied to clipboard

Install Failed

Open renlight10 opened this issue 7 years ago • 12 comments

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
  • environment Ubuntu

renlight10 avatar Jan 16 '17 14:01 renlight10

re2c is not installed

Yo have to install re2c

sergeyklay avatar Jan 16 '17 14:01 sergeyklay

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

renlight10 avatar Jan 16 '17 22:01 renlight10

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

sudo apt-get install automake

sergeyklay avatar Jan 16 '17 22:01 sergeyklay

Try installing automate and the issue should be solved.

jimthunderbird avatar Jan 17 '17 00:01 jimthunderbird

Oops I mean automake:)

jimthunderbird avatar Jan 17 '17 00:01 jimthunderbird

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

renlight10 avatar Jan 17 '17 09:01 renlight10

Did php install properly?

jimthunderbird avatar Jan 18 '17 04:01 jimthunderbird

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

sergeyklay avatar Jan 18 '17 06:01 sergeyklay

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] ...

LucasMali avatar Aug 24 '17 01:08 LucasMali

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

Stevehans avatar Oct 29 '17 17:10 Stevehans

@LucasMaliszewski

Warning: re2c 1.0.1 is already installed

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

sergeyklay avatar Oct 30 '17 02:10 sergeyklay

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.

Muqsit avatar Jun 24 '18 12:06 Muqsit