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

Phalconphp installation trouble on PHP 7.1 with ISP manager 5 Lite (with php selector)

I have a problem with installing Phalcon for PHP 7.1

There is a VPS with ISP Manager Lite 5 control panel in which a PHP selector is built.

The main version of PHP on server 5.6 and Phalcon compiled and works well with it.

BUT

For individual domains, I choose PHP and Phalcon 7.1 of course for this version Phalcon is not installed.

How can I install Phalcon in this case?



14.3k
edited Feb '18

OS Centos 7

ISPmanager Lite 5.135.1

https://yadi.sk/i/74wbMQga3SJxEx

Apparenlty, your ISPManager does not support PHP7.1 + Phalcon. If it's a proper VPS (you have root access), you could compile it from source and add it to your ISPM plugins folder or whatever it's documentation says.



14.3k

It is clear that it is necessary to compile. The question is how to compile Phalcon specifically under PHP 7.1??

Because if I run build/install it compiled under PHP 5.6



14.3k

I tried to do according to this post: https://forum.phalcon.io/discussion/14893/set-phpconfig-while-phalcon-install-on-centos#C43353

result:

[[email protected] ext]# cd /root/cphalcon-master/build/php7/64bits
[[email protected] 64bits]# /opt/php71/bin/phpize --enable-phalcon --with-php-config=/opt/php71/bin/php-config
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
[[email protected] 64bits]# ./configure --with-php-config=/opt/php71/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
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 cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -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-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /opt/php71
checking for PHP includes... -I/opt/php71/include/php -I/opt/php71/include/php/main -I/opt/php71/include/php/TSRM -I/opt/php71/include/php/Zend -I/opt/php71/include/php/ext -I/opt/php71/include/php/ext/date/lib
checking for PHP extension directory... /opt/php71/lib/php/modules
checking for PHP installed headers prefix... /opt/php71/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable phalcon... yes, shared
checking whether HAVE_BUNDLED_PCRE is declared... yes
checking for ext/pcre/php_pcre.h... yes
checking whether HAVE_JSON is declared... no
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
./configure: line 5216: /usr/bin/file: No such file or directory
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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1966080
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld) 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

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
[[email protected] 64bits]# make
/bin/sh /root/cphalcon-master/build/php7/64bits/libtool --mode=compile cc  -I. -I/root/cphalcon-master/build/php7/64bits -DPHP_ATOM_INC -I/root/cphalcon-master/build/php7/64bits/include -I/root/cphalcon-master/build/php7/64bits/main -I/root/cphalcon-master/build/php7/64bits -I/opt/php71/include/php -I/opt/php71/include/php/main -I/opt/php71/include/php/TSRM -I/opt/php71/include/php/Zend -I/opt/php71/include/php/ext -I/opt/php71/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /root/cphalcon-master/build/php7/64bits/phalcon.zep.c -o phalcon.lo
mkdir .libs
 cc -I. -I/root/cphalcon-master/build/php7/64bits -DPHP_ATOM_INC -I/root/cphalcon-master/build/php7/64bits/include -I/root/cphalcon-master/build/php7/64bits/main -I/root/cphalcon-master/build/php7/64bits -I/opt/php71/include/php -I/opt/php71/include/php/main -I/opt/php71/include/php/TSRM -I/opt/php71/include/php/Zend -I/opt/php71/include/php/ext -I/opt/php71/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/cphalcon-master/build/php7/64bits/phalcon.zep.c  -fPIC -DPIC -o .libs/phalcon.o
cc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugzilla.redhat.com/bugzilla> for instructions.
make: *** [phalcon.lo] Error 1
[[email protected] 64bits]#

Try it like so:

cd cphalcon/build
sudo ./install --with-php-config=/opt/php71/bin/php-config


14.3k
[[email protected] ~]# cd cphalcon-master/build
[[email protected] build]# sudo ./install --with-php-config=/opt/php71/bin/php-config
./install: illegal option -- -
./install: illegal option -- w
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/*
./install: line 119: th-php-config=/opt/php71/bin/php-config: No such file or directory
./install: line 123: th-php-config=/opt/php71/bin/php-config: No such file or directory
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
./configure: line 6720: /usr/bin/file: No such file or directory
libtool: compile:  gcc -I. -I/root/cphalcon-master/build/php5/64bits -DPHP_ATOM_INC -I/root/cphalcon-master/build/php5/64bits/include -I/root/cphalcon-master/build/php5/64bits/main -I/root/cphalcon-master/build/php5/64bits -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -c /root/cphalcon-master/build/php5/64bits/phalcon.zep.c  -fPIC -DPIC -o .libs/phalcon.o
libtool: link: gcc -shared  -fPIC -DPIC  .libs/phalcon.o    -march=native -mtune=native -O2   -Wl,-soname -Wl,phalcon.so -o .libs/phalcon.so
libtool: link: ( cd ".libs" && rm -f "phalcon.la" && ln -s "../phalcon.la" "phalcon.la" )
libtool: install: cp ./.libs/phalcon.so /root/cphalcon-master/build/php5/64bits/modules/phalcon.so
libtool: install: cp ./.libs/phalcon.lai /root/cphalcon-master/build/php5/64bits/modules/phalcon.la
libtool: finish: PATH="/sbin:/bin:/usr/sbin:/usr/bin:/sbin" ldconfig -n /root/cphalcon-master/build/php5/64bits/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /root/cphalcon-master/build/php5/64bits/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/lib64/php/modules/
Installing header files:           /usr/include/php/

Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation

[[email protected] build]#


14.3k

It seems that the installer has not found the configuration file (although the file is in place) and compiled for PHP 5.6

edited Feb '18

Sorry, you don't need the with- prefix, and also need to set the --phpize option:

cd cphalcon/build
sudo ./install --php-config=/opt/php71/bin/php-config --phpize=/opt/php71/bin/phpize

https://github.com/phalcon/cphalcon/blob/master/build/install#L23



14.3k

This time the situation changed, but the compilation failed again

[[email protected] build]# sudo ./install --php-config /opt/php71/bin/php-config --phpize /opt/php71/bin/phpize
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:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
./configure: line 5216: /usr/bin/file: No such file or directory
appending configuration tag "CXX" to libtool
mkdir .libs
 gcc -I. -I/root/cphalcon-master/build/php7/64bits -DPHP_ATOM_INC -I/root/cphalcon-master/build/php7/64bits/include -I/root/cphalcon-master/build/php7/64bits/main -I/root/cphalcon-master/build/php7/64bits -I/opt/php71/include/php -I/opt/php71/include/php/main -I/opt/php71/include/php/TSRM -I/opt/php71/include/php/Zend -I/opt/php71/include/php/ext -I/opt/php71/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -c /root/cphalcon-master/build/php7/64bits/phalcon.zep.c  -fPIC -DPIC -o .libs/phalcon.o
gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugzilla.redhat.com/bugzilla> for instructions.
make: *** [phalcon.lo] Error 1
 gcc -I. -I/root/cphalcon-master/build/php7/64bits -DPHP_ATOM_INC -I/root/cphalcon-master/build/php7/64bits/include -I/root/cphalcon-master/build/php7/64bits/main -I/root/cphalcon-master/build/php7/64bits -I/opt/php71/include/php -I/opt/php71/include/php/main -I/opt/php71/include/php/TSRM -I/opt/php71/include/php/Zend -I/opt/php71/include/php/ext -I/opt/php71/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -c /root/cphalcon-master/build/php7/64bits/phalcon.zep.c  -fPIC -DPIC -o .libs/phalcon.o
gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugzilla.redhat.com/bugzilla> for instructions.
make: *** [phalcon.lo] Error 1

Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation

[[email protected] build]#


14.3k

Is it possible to do so:

you compile the .so module for PHP 7.1 64 bits. I'll download your version, put it in modules and will work ?



77.7k
Accepted
answer
edited Feb '18

No, since the binary is architecture dependant...

That's a compiler crash btw, how much RAM do you have? Setting up a swap space may help



14.3k

It seems you are right. I will try to increase the swap

https://yadi.sk/i/FFdAW3lM3SLYkq



14.3k

Indeed, there was not enough RAM to finish compilation. After increasing everything went well. Phalcon module works fine with PHP selector (on 7.1)