Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Installation on Raspbery Pi

Hi,

I'm trying to install Phalcon PHP on a Raspberry PI by following the procedure described here : http://debrepo.frbit.com/

When executing the last command, i have the following message :

sudo aptitude install php5-igbinary php5-mongo php5-oauth php5-phalcon php5-runkit php5-stats php5-stomp php5-yaf php5-yaml

The following NEW packages will be installed:

  • php5-igbinary{b} php5-mongo{b} php5-oauth{b} php5-phalcon{b} php5-runkit{b}
  • php5-stats{b} php5-stomp{b} php5-yaf{b} php5-yaml{b}

  • 0 packages upgraded, 9 newly installed, 0 to remove and 1 not upgraded.

  • Need to get 1,121 kB of archives. After unpacking 3,981 kB will be used.
  • The following packages have unmet dependencies:

  • php5-oauth : Depends: phpapi-20100525 which is a virtual package.

  • php5-yaf : Depends: phpapi-20100525 which is a virtual package.
  • php5-runkit : Depends: phpapi-20100525 which is a virtual package.
  • php5-stats : Depends: phpapi-20100525 which is a virtual package.
  • php5-mongo : Depends: phpapi-20100525 which is a virtual package.
  • php5-stomp : Depends: phpapi-20100525 which is a virtual package.
  • php5-igbinary : Depends: phpapi-20100525 which is a virtual package.
  • php5-yaml : Depends: phpapi-20100525 which is a virtual package.
  • php5-phalcon : Depends: phpapi-20100525 which is a virtual package.

The following actions will resolve these dependencies:

 Keep the following packages at their current version:

* 1) php5-igbinary [Not Installed] * 2) php5-mongo [Not Installed] * 3) php5-oauth [Not Installed] * 4) php5-phalcon [Not Installed] * 5) php5-runkit [Not Installed] * 6) php5-stats [Not Installed] * 7) php5-stomp [Not Installed] * 8) php5-yaf [Not Installed] * 9) php5-yaml [Not Installed]

Accept this solution? [Y/n/q/?] Y No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used.

I have no idea of what to do .... :/

Thanks in advance for your help.



5.1k

Hello

There are missing dependencies apparently.

Btw, PhalconPHP won't combile on a Raspbery Pi if its RAM is only 512 MB. In my experience, I needed at least 2 GB of RAM to have it combiled successfully.

Regards



2.2k

Ok, i also tried the compilation with no success ...

I've seen a topic of a benchmark of Phalcon on a Raspberry pi (read the results at https://gist.github.com/hdogan/5466569).

So i think it's must be possible to install it on a R-PI ...



5.1k
Accepted
answer

Maybe they combined it on a stronger machine then transferred phalcon.so to RPi



2.2k

You mean compiled it on other machine and then tranferred it to RPI ?

How can i do that ? I'm novice on Debian ... :/



5.1k

It's very difficult and it requires experience.

It's better now to resolve the dependencies, then try to use swap file, it may hell. But it is going to be very long.



2.2k

How can i resolve dependencies ?



5.1k

It tells you that the packages "Depend: phpapi-20100525 which is a virtual package."

A quick search returns this: https://packages.debian.org/wheezy/phpapi-20100525

So you just need to go these things and install them one by one, and then try again.

Regards



2.2k

I finally succeeded to compile Phalcon PHP and make it works on my RPI.

Thanks for your help :)



5.1k

I'm glad you've made it.

Please don't forget to mark my answer at the right answer so other peopel find the solution easily.

Regards



67

Hi,

Munkey74, can you upload your phalcon.so that worked on your RPI ?

Thanks.

edited May '15

Hi,

I'm making a LAMP webserver on my Raspberry Pi and want to use Phalcon PHP framework for the website. So long everything worked smooth but I can't install Phalcon PHP. Could you please explain how you got it to work?

I have cloned the cphalcon directory to my RPi but after running "sudo ./install" i get a wall of text. I added it here



5.1k

It won't combile on RPi because it has limitted memory.

It won't combile on RPi because it has limitted memory.

But Munkey74 wrote

I finally succeeded to compile Phalcon PHP and make it works on my RPI. Thanks for your help :)

That's why I'm asking. I've checked all over but can't find a answer. Excepts that Munkey74 got it to work.



5.1k

You haven't read the whole topic apparently, I told him to combile it on a device that has better memory, then to move it to RPi. And you got to pay attention to the pathes.

I have installed Phalcon PHP on my laptop & been using it. So what do I need to move to RPi? Just the phalcon.so or some libraries? Sorry but I'm a begginer when talking about this kind of stuff.

I found two phalcon.so" files on my home directory:

/home/myuser/cphalcon/build/64bits/.libs/phalcon.so /home/myuser/cphalcon/build/64bits/modules/phalcon.so

Which one do I use? Or I need a phalcon.so from a build/32bits folder because of RPi not using 64bit architecture?



5.1k

phalcon.so is enough, any differences in the architchte could render the file unusable on RPi.



2.2k

Hello,

I've made it a long time ago, but did you try the procedure described here http://docs.phalconphp.com/fr/latest/reference/install.html#compilation ?

I'm pretty sure that i compiled it on de RPi, maybe i had overclocked it before compiling ...

Wich version of th RPi do you have ?

I have a RPi 1 model B.

Could the overclocking help? I tried the recommended compilation "git->cd->sudo ./install" but it didn't work.



2.2k

I have the same RPi and i compiled Phalcon on it, is it a restriction from the new versions of Phalcon ?

You need to install the PCRE extension

edited May '15

I don't know. I've used Phalcon for a short time and it's first time trying to install it on RPi.

How could I install a previous version of Phalcon?

EDIT: I checked & i have already install libpcre3, libpcre3-dev extensions. Tried running "sudo /.install" once again and got

libtool: compile: gcc -I. -I/home/pi/cphalcon/build/32bits -DPHPATOMINC -I/home/pi/cphalcon/build/32bits/include -I/home/pi/cphalcon/build/32bits/main -I/home/pi/cphalcon/build/32bits -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DLARGEFILESOURCE -DFILEOFFSETBITS=64 -DPHALCONRELEASE -DHAVECONFIGH -O2 -finline-functions -fomit-frame-pointer -fvisibility=hidden -c /home/pi/cphalcon/build/32bits/phalcon.zep.c -fPIC -DPIC -o .libs/phalcon.o In file included from /usr/include/php5/ext/spl/spliterators.h:27:0, from /home/pi/cphalcon/build/32bits/phalcon.zep.c:206: /usr/include/php5/ext/pcre/phppcre.h:37:1: error: unknown type name 'pcre' /usr/include/php5/ext/pcre/phppcre.h:37:51: error: unknown type name 'pcreextra' /usr/include/php5/ext/pcre/phppcre.h:38:1: error: unknown type name 'pcre' /usr/include/php5/ext/pcre/phppcre.h:38:54: error: unknown type name 'pcreextra' /usr/include/php5/ext/pcre/phppcre.h:44:2: error: unknown type name 'pcre' /usr/include/php5/ext/pcre/phppcre.h:45:2: error: unknown type name 'pcreextra' /home/pi/cphalcon/build/32bits/phalcon.zep.c: In function 'ppsyntaxerror': /home/pi/cphalcon/build/32bits/phalcon.zep.c:98723:0: warning: "TOKEN" redefined [enabled by default] /home/pi/cphalcon/build/32bits/phalcon.zep.c:29228:0: note: this is the location of the previous definition /home/pi/cphalcon/build/32bits/phalcon.zep.c: In function 'vvsyntaxerror': /home/pi/cphalcon/build/32bits/phalcon.zep.c:116831:0: warning: "TOKEN" redefined [enabled by default] /home/pi/cphalcon/build/32bits/phalcon.zep.c:98723:0: note: this is the location of the previous definition Makefile:171: recipe for target 'phalcon.lo' failed make: * [phalcon.lo] Error 1

It still says it can't find pcre:

/usr/include/php5/ext/pcre/php_pcre.h:37:1: error: unknown type name 'pcre' /usr/include/php5/ext/pcre/php_pcre.h:37:51: error: unknown type name 'pcre_extra' /usr/include/php5/ext/pcre/php_pcre.h:38:1: error: unknown type name 'pcre' /usr/include/php5/ext/pcre/php_pcre.h:38:54: error: unknown type name 'pcreextra' /usr/include/php5/ext/pcre/phppcre.h:44:2: error: unknown type name 'pcre' /usr/include/php5/ext/pcre/php_pcre.h:45:2: error: unknown type name 'pcre_extra'

Maybe it requires a higher version of PCRE or removing this section from the config.m4 will tell Phalcon that you don't have PCRE installed: https://github.com/phalcon/cphalcon/blob/2.0.x/build/32bits/config.m4#L21-L29

edited May '15

Hi again!

I checked for any other PCRE extension, checked the PCRE version (8.31). Version checked in web with phpinfo(). I tried to remove those lines from config.m4 but it didn't work. Did I find it at the correct directory -> /cphalcon/build/32bits/config.m4?

I wanted to purge libpcre3 & libpcre3-dev but I got this message

sudo apt-get purge libpcre3 Reading package lists... Done Building dependency tree
Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: apache2.2-bin : Depends: libpcre3 (>= 8.10) but it is not going to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

============ EDIT ============

Found .deb packages with newer versions of libpcre3/-dev extensions. Tried updating but the same. Now server works but phpinfo() does not.

Doing a fresh install of raspbian.

edited May '15

Hi again.

Sorry for lifting this up again but I really need it to work. My qualification work needs to be finished in two weeks & my site uses Phalcon for the framework.

I did a fresh install of raspbian, installed apache, php, mysql and phpmyadmin. Everything works. The last step is to get Phalcon running and then transferring my website to RPi server. I haven't tried to install phalcon yet. With phpinfo() found out PCRE lib version is 8.31 2012-07-06 and PCRE Support is enabled.

P.S. I now overclocked the RPi to 'modest' = 800MHz.

Could downloading Phalcon on a 32bit Ubuntu version then transferring .deb package and installing it to RPi work?

How could I get my hands on Phalcon 1.3.4 version to try and install it? Maybe it's something to do with Zephyr & I could not install that.

Really need some help here because if don't get it to work in a week I don't graduate.

edited Jun '15

When I run "sudo ./install" it starts compiling & then compilation just stops here. It never ends.

libtool: compile: gcc -I. -I/home/pi/cphalcon/build/32bits -DPHPATOMINC -I/home/pi/cphalcon/build/32bits/include -I/home/pi/cphalcon/build/32bits/main -I/home/pi/cphalcon/build/32bits -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DLARGEFILESOURCE -DFILEOFFSETBITS=64 -DPHALCONRELEASE -DHAVECONFIGH -O2 -finline-functions -fomit-frame-pointer -fvisibility=hidden -c /home/pi/cphalcon/build/32bits/phalcon.zep.c -fPIC -DPIC -o .libs/phalcon.o

I stop it and I get:

Makefile:171: recipe for target 'phalcon.lo' failed make: * [phalcon.lo] Error 1

Maybe it needs more memory to finish the compilation, try adding more swap

Ok, thanks. I added more swap, started compiling and left for an hour on maybe a bit more. Installed Phalcon PHP successfully! Finally got it to work!

So little recap. RPi settings:

  • Overclocked to "modest";
  • Installed Apache, MySQL, PHP and Phpmyadmin;
  • Updated re2c library version (must be higher than 0.13.2) <- do this so Phalcon can find the PCRE libraries;
  • Changed swapsize to 256mb.

Phalcon PHP installation:

  1. sudo apt-get install php5-dev php5-mysql gcc libpcre3-dev
  2. git clone --depth=1 git://github.com/phalcon/cphalcon.git
  3. cd cphalcon/build
  4. sudo ./install
  5. Wait a long time when it start compiling