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

Distributing phalcon.so precompiled

We are finally starting the first tests of our software in production, and for our context would be really nice to ship phalcon.so (1.3.2) already compiled. Besides the hardware, we are making sure to reproduce almost the same envioriment for development and production. From first tests everything is working well so far, but I need to ask if someone knows what are the risks of distributing a precompiled version of the framework, can some functionality get broken by doing this? Like file handling or whatever?

Also, minor question about Phalcon 2.0. Once we compiled the framework, Zephir and json-c is no longer required in the machine right?

Thanks in advance!



98.9k
Accepted
answer

That would be hard because we have to compile each of these combinations:

  • PHP 5.3.3 NTS
  • PHP 5.3.3 TS
  • PHP > 5.3.3 NTS
  • PHP > 5.3.3 TS
  • PHP 5.4.x NTS
  • PHP 5.4.x TS
  • PHP 5.5.x NTS
  • PHP 5.5.x TS
  • PHP 5.6.x NTS
  • PHP 5.6.x TS

...And generate all these combinations for every linux distribution and every version of that linux distribution. This is needed because the phalcon.so (as any shared library) links to functions that are not in the shared library but in external binaries like the php one or the libc version in the target machine. Linking the wrong functions along with the phalcon.so binary could lead to segfaults or invalid memory accesses.

Indeed, it's perfectly reasonable to Phalcon be distributed this way. But I was asking more about those that have total control on the production environment (like a hosting company), sorry if wasn't clear on that.

I not going to bother you with the full context, but basically we've got considerable amount servers with everything but the hardware almost identical(from the OS to the installed package versions), and we'll add a component powered by Phalcon to all those guys. We're thinking in take benefit from this and bundle the phalcon.so within this new component. From your experience you can tell something that can go wrong with this approach even in those very similar environments? I would be really glad if you can share your thoughts.



8.1k

@cvsguimaraes have you thought about a virtualized solution (so you can deploy the exact same image everywhere)?