We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Error on build Phalcon 2.0.x with PHP 5.6 on Ubuntu 16.04

In my Ubuntu I have installed two versions of PHP (5.6 and 7.0) In a project I'm working needs Phalcon 2.0.x and PHP 5.6, so I try build Phalcon 2.0.x but the build is showing a error.

Note: I installed all dependencies that Phalcon need to work sudo apt-get install php5.6-dev libpcre3-dev gcc make

I followed the steps of this documentation https://docs.phalcon.io/en/latest/reference/install.html

Thanks in advance

~/cphalcon/build on 2.0.x [!] via ⬢ v6.3.0 
➔ sudo ./install

[sudo] password for donald: 
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f 
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la       modules/* libs/*
Cleaning..
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for icc... no
checking for suncc... no
checking whether gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20151012
checking for PHP installed headers prefix... /usr/include/php/20151012
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable phalcon... yes, shared
checking whether HAVE_BUNDLED_PCRE is declared... no
checking whether HAVE_JSON is declared... no
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) nawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
/bin/bash /home/donald/cphalcon/build/64bits/libtool --mode=compile gcc  -I. -I/home/donald/cphalcon/build/64bits -DPHP_ATOM_INC -I/home/donald/cphalcon/build/64bits/include -I/home/donald/cphalcon/build/64bits/main -I/home/donald/cphalcon/build/64bits -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib  -DPHALCON_RELEASE -DHAVE_CONFIG_H  -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden   -c /home/donald/cphalcon/build/64bits/phalcon.zep.c -o phalcon.lo 
libtool: compile:  gcc -I. -I/home/donald/cphalcon/build/64bits -DPHP_ATOM_INC -I/home/donald/cphalcon/build/64bits/include -I/home/donald/cphalcon/build/64bits/main -I/home/donald/cphalcon/build/64bits -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden -c /home/donald/cphalcon/build/64bits/phalcon.zep.c  -fPIC -DPIC -o .libs/phalcon.o
In file included from /home/donald/cphalcon/build/64bits/phalcon.zep.c:175:0:
/home/donald/cphalcon/build/64bits/phalcon.zep.h:433:8: error: unknown type name ‘zend_object_value’
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_Validator(zen
        ^
/home/donald/cphalcon/build/64bits/phalcon.zep.h:7103:8: error: unknown type name ‘zend_object_value’
 static zend_object_value zephir_init_properties_Phalcon_Assets_Collection(zend_
        ^
/home/donald/cphalcon/build/64bits/phalcon.zep.h:11600:8: error: unknown type name ‘zend_object_value’
 static zend_object_value zephir_init_properties_Phalcon_Http_Response_Headers(z
        ^
/home/donald/cphalcon/build/64bits/phalcon.zep.h:18100:8: error: unknown type name ‘zend_object_value’
 static zend_object_value zephir_init_properties_Phalcon_Translate_Adapter_Csv(z
        ^
/home/donald/cphalcon/build/64bits/phalcon.zep.c:184:40: fatal error: ext/standard/php_smart_str.h: No such file or directory
compilation terminated.
Makefile:194: recipe for target 'phalcon.lo' failed
make: *** [phalcon.lo] Error 1
edited Jul '16

You need to make sure you're actually using PHP 5.6 and not PHP 7.0.8 which is default on Ubuntu Xerus. Looking at your compile output,

Configuring for:
PHP Api Version:         20151012

indicates you're still using PHP 7.

Well yea, 20151012 means php 7. As far as i know you need add ppa to install php 5.6.

Actually not. You can always compile it on your own, that's what I did on one production Debian Wheezy server (PHP5.4 was default). What can be an issue is to maintain both versions in Xerus. It's better to remove PHP7 then if you don't use it. But I did managed to have both 5.6 and 7.0.4(8) on the same Xerus instance. Long live PHP-FPM and Nginx! :)

edited Jul '16

Unfortunately I need the two versions of PHP (5.6 and 7). I configured NGINX to run PHP5.6 and I use Laravel in PHP7. But I need to use Phalcon in PHP5.6, how could I do that?

You know? Thanks again

Actually not. You can always compile it on your own, that's what I did on one production Debian Wheezy server (PHP5.4 was default). What can be an issue is to maintain both versions in Xerus. It's better to remove PHP7 then if you don't use it. But I did managed to have both 5.6 and 7.0.4(8) on the same Xerus instance. Long live PHP-FPM and Nginx! :)

edited Jul '16

Post contents of the following cmd:

file /etc/alternatives/php

Also, run the following:

whereis phpize
which phpize
phpize -v

Then i just recommend to use phpbrew, otherwise is nasty to work on few php versions.

~/Projects/warehouse on plans via ⬢ v6.3.0 
➔ file /etc/alternatives/php
/etc/alternatives/php: symbolic link to /usr/bin/php7.0

~/Projects/warehouse on plans via ⬢ v6.3.0 
➔ whereis phpize
phpize: /usr/bin/phpize /usr/bin/phpize7.0 /usr/bin/phpize5.6 /usr/share/man/man1/phpize.1.gz

~/Projects/warehouse on plans via ⬢ v6.3.0 
➔ which phpize
/usr/bin/phpize

~/Projects/warehouse on plans via ⬢ v6.3.0 
➔ phpize -v
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012

Post contents of the following cmd:

file /etc/alternatives/php

Also, run the following:

whereis phpize
which phpize
phpize -v
edited Jul '16

@Jurigag: I had similar needs for Xerus, the only exception being I don't run Phalcon there, the thing is, if you point out to the correct phpize, there should be no issues to glue it with PHP5.x only, while keeping default PHP7 intact.

@donnes: How did you installed PHP5.6? From PPA or compiled it on your own?

Post results of: whereis php you should see something like: /usr/bin/php5.6

@stamster: I installed using sudo apt-get install php5.6 php5.6-dev

This is what whereis php showed:

➔ whereis php
php: /usr/bin/php /usr/bin/php7.0 /usr/bin/php5.6 /usr/lib/php /etc/php /usr/include/php /usr/share/php7.0-curl /usr/share/php7.0-readline /usr/share/php /usr/share/php7.0-intl /usr/share/php7.0-json /usr/share/php7.0-pgsql /usr/share/php5.6-common /usr/share/php5.6-json /usr/share/php7.0-zip /usr/share/php5.6-opcache /usr/share/php7.0-gd /usr/share/php5.6-readline /usr/share/php7.0-mysql /usr/share/php7.0-xml /usr/share/php7.0-mbstring /usr/share/php7.0-opcache /usr/share/php7.0-common /usr/share/man/man1/php.1.gz
edited Jul '16

You'd need to change /etc/alternatives/phpize to symlink to a correct PHP version, you'll find it out by using whereis phpize. In your setup case, that would be: /usr/bin/phpize5.6

I would just edit Phalcon's install script (/full/path/to/cphalcon-phalcon-v2.0.13/build/install), instead of:

#Clean current compilation
if [ -f Makefile ]; then
        make clean
        phpize --clean
fi

#Perform the compilation
phpize && ./configure --enable-phalcon && make && make install && echo -e "\nTh$

point out to the absolute path of your phpize:

#Clean current compilation
if [ -f Makefile ]; then
        make clean
        /usr/bin/phpize5.6 --clean
fi

#Perform the compilation
/usr/bin/phpize5.6 && ./configure --enable-phalcon && make && make install && echo -e "\nTh$

@stamster: I changed the install script but the same (I think) error is happening

find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f 
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la       modules/* libs/*
Cleaning..
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for icc... no
checking for suncc... no
checking whether gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20151012
checking for PHP installed headers prefix... /usr/include/php/20151012
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable phalcon... yes, shared
checking whether HAVE_BUNDLED_PCRE is declared... no
checking whether HAVE_JSON is declared... no
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) nawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
/bin/bash /home/donald/cphalcon/build/64bits/libtool --mode=compile gcc  -I. -I/home/donald/cphalcon/build/64bits -DPHP_ATOM_INC -I/home/donald/cphalcon/build/64bits/include -I/home/donald/cphalcon/build/64bits/main -I/home/donald/cphalcon/build/64bits -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib  -DPHALCON_RELEASE -DHAVE_CONFIG_H  -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden   -c /home/donald/cphalcon/build/64bits/phalcon.zep.c -o phalcon.lo 
libtool: compile:  gcc -I. -I/home/donald/cphalcon/build/64bits -DPHP_ATOM_INC -I/home/donald/cphalcon/build/64bits/include -I/home/donald/cphalcon/build/64bits/main -I/home/donald/cphalcon/build/64bits -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden -c /home/donald/cphalcon/build/64bits/phalcon.zep.c  -fPIC -DPIC -o .libs/phalcon.o
In file included from /home/donald/cphalcon/build/64bits/phalcon.zep.c:175:0:
/home/donald/cphalcon/build/64bits/phalcon.zep.h:433:8: error: unknown type name ‘zend_object_value’
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_Validator(zend_class_entry *class_type TSRMLS_DC);
        ^
/home/donald/cphalcon/build/64bits/phalcon.zep.h:7103:8: error: unknown type name ‘zend_object_value’
 static zend_object_value zephir_init_properties_Phalcon_Assets_Collection(zend_class_entry *class_type TSRMLS_DC);
        ^
/home/donald/cphalcon/build/64bits/phalcon.zep.h:11600:8: error: unknown type name ‘zend_object_value’
 static zend_object_value zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_entry *class_type TSRMLS_DC);
        ^
/home/donald/cphalcon/build/64bits/phalcon.zep.h:18100:8: error: unknown type name ‘zend_object_value’
 static zend_object_value zephir_init_properties_Phalcon_Translate_Adapter_Csv(zend_class_entry *class_type TSRMLS_DC);
        ^
/home/donald/cphalcon/build/64bits/phalcon.zep.c:184:40: fatal error: ext/standard/php_smart_str.h: No such file or directory
compilation terminated.
Makefile:181: recipe for target 'phalcon.lo' failed
make: *** [phalcon.lo] Error 1
edited Jul '16

You know that to this time you already spend you could install phpbrew, compile php 5.6 an 7 and have nice and easy way to switch betwenn them and compile phalcon without problem ? If you want to use many php versions on your server this id one and only way(despite some virtualization like docker or vagrant) you should use - https://github.com/phpbrew/phpbrew

Editing files, passing whole path etc weird things is just nasty as fck.

@Jurigag I'll try it. Just a question, If I already have PHP version on my system I need install PHP again with phpbrew?

Yes but you really should do it beacause it will be like MUCH EASIER to manage both php versions.

You have pointed out to the correct API:

Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226

But it seems that Phalcon build process still checks for 'advertised' PHP API path, thus it found /usr/include/php/20151012/main which is API for PHP7.

edited Jul '16

Just managing two or more php versions yourself, ESPECIALLY WHEN IT COMES TO INSTALLING/COMPILING extensions is super annoying and phpbrew is way to go, beacause he will just changes all binaries to proper.

@Jurigag @stamster Thank you so much for helping. I'm testing phpbrew, but he'is having some issues. If I can't solve I back here to bother you :P

Thanks again



21.7k
edited Aug '16

No. Phpbrew increases headache right now. But the idea is cool, yes.

And, among other things, cannot install phalcon (see issue in phpbrew).

Just managing two or more php versions yourself, ESPECIALLY WHEN IT COMES TO INSTALLING/COMPILING extensions is super annoying and phpbrew is way to go, beacause he will just changes all binaries to proper.

What ? But you know you can just clone repo and install phalcon as usual ?

No. Phpbrew increases headache right now. But the idea is cool, yes.

And, among other things, cannot install phalcon (see issue in phpbrew).

Just managing two or more php versions yourself, ESPECIALLY WHEN IT COMES TO INSTALLING/COMPILING extensions is super annoying and phpbrew is way to go, beacause he will just changes all binaries to proper.

edited Aug '16

I managed to override PHP version from build/install script.

In my case I have compiled on my own latest PHP 5.6 on path /var/local So in install script, just after this part:

# Check best compilation flags for GCC
export CC="gcc"
export CFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer"
export CPPFLAGS="-DPHALCON_RELEASE"

I added: PATH=/var/local/bin:$PATH

Afterwards, Phalcon installer went to search for phpize and php-config in overriden bin path, and compilation process went through like a charm.

So, @donnes and @TrogWarZ just put there your path to bin where is your PHP version installed.



21.7k
edited Aug '16

Sure, i can clone phalcon repo and compile it as usual, then copy-paste files to phpbrew directory.

$ git clone git://github.com/phalcon/cphalcon.git /tmp/cphalcon
$ cd /tmp/cphalcon/build
$ git checkout 1.3.6 # or 3.0.x for new version
$ ./install
$ cp /etc/php5/mods-available/phalcon.ini /root/.phpbrew/php/php-5.6.25/var/db/phalcon.ini
$ php -m | grep phalcon

This works. But wait, i can install like this any extension (or even just type pecl install {extension_name} sometimes).

Just pointing out two things: feature phpbrew ext install github:phalcon/[email protected] doesn't working and you need to compile phalcon manually even if you use phpbrew. That's all.

And, if you can install phalcon with this command, share, please, solution – maybe, i'm doing it wrong?

What ? But you know you can just clone repo and install phalcon as usual ?

No. Phpbrew increases headache right now. But the idea is cool, yes.

And, among other things, cannot install phalcon (see issue in phpbrew).

Just managing two or more php versions yourself, ESPECIALLY WHEN IT COMES TO INSTALLING/COMPILING extensions is super annoying and phpbrew is way to go, beacause he will just changes all binaries to proper.

@stamster, hmm, i guess, don't understand you (-: With compiling from sources – everything is okay – i'm using update-alternatives utility for linking php/php-fpm/phpize/php-config versions. Waiting for @donnes – if phpbrew, update-alternatives, or your solution helps him or not.

edited Aug '16

What ? You don't need to copy anything men, just remove default php5 :D And use only phpbrew php. Im just doing:

cd cphalcon
phpbrew switch 5.6.19
zephir build

Thank you, phalcon installed on php from phprew 5.6.19.

cd ../zephir/parser
make clean
phpize --clean
cd ../..cphalcon
phpbrew switch 7.0.9
zephir build

Thank you, phalcon installed on php from phpbrew 7.0.9

Im not using this command, is three commands(or more) vs one such a problem ?



21.7k
edited Aug '16

You don't need to copy anything men

Just make clean install (purge any php and phpbrew, remove /etc/php* and ~/.phpbrew and after that install php/phpbrew) and you'll see that after building phalcon from sources, ini-file doesn't even exists anywhere. So, you need to copy it or create by hands.

just remove default php5 :D

Why? Phpbrew requires default php5 to install. After install phpbrew and any of php version – maybe system php can be removed (tested right now).

Im not using this command, is three commands(or more) vs one such a problem ?

I don't care about number of lines and can install any extension from sources without phpbrew – it's not helping here, but in docs – i must be able to do this. So, it's defenitely a bug but i don't know where and why.

cd cphalcon && 
phpbrew switch 5.6.19 &&
zephir build

Really (o.0)? In docs i see this: apt-get install php5-phalcon but it's not working because of lack system php5. Plus, on the same page, i don't see any zephir suggestions – only "my" method above with ./install.

What's difference between "zephir-based" and "./install-based"? And why i do need additional dependency (zephir) to just use phalcon?

ps: i think, this thread betweeen us is verbalism – task "php and phalcon enabled" is done completely. I just care "how it was done" and "why real life and comments on forum differs from documentation".

edited Aug '16

I have clean install, i don't need to copy anything :) Just needed to remove system php5. You just need to uninstall php5. You can as well do cd build ./install without needing the zephir, result is the same. I'm not copying any files and it's working for me. I have have vagrant phalcon, i didn't installed zephir, also doing coding in zephir so i need zephir.

Actually removing is not even needed. Just type phpbrew switch <php version> before installing phalcon and you done, no need to copy ini file.



21.7k
edited Aug '16

Okay, then why it not works before i manually locate so-file and create ini-file? What i'm doing wrong?

System php is removed and purged. Then Phalcon installed via "clone repo and ./install".

# php -v
PHP 5.6.25 (cli) (built: Aug 23 2016 19:59:17)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans

# phpbrew ext | grep phalcon
 [ ] phalcon

# php -r "echo 'Phalcon version: ' . \Phalcon\Version::get() . PHP_EOL;"

Fatal error: Class 'Phalcon\Version' not found in Command line code on line 1

Call Stack:
    0.0001     223072   1. {main}() Command line code:0

# phpbrew ext enable phalcon
===> Enabling extension phalcon
phalcon extension is not installed. Suggestions:
        $ phpbrew ext install phalcon

# locate phalcon.ini

# locate phalcon.so
/root/.phpbrew/php/php-5.6.25/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so

# echo 'extension=/root/.phpbrew/php/php-5.6.25/lib/php/extensions/no-debug-non-zts-20131226/phalcon.so' > /root/.phpbrew/php/php-5.6.25/var/db/phalcon.ini

# phpbrew ext | grep phalcon
 [*] phalcon      1.3.6

# php -r "echo 'Phalcon version: ' . \Phalcon\Version::get() . PHP_EOL;"
Phalcon version: 1.3.6