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.

Error in model 'find', 'findFirst methods with latest Phalcon 2.1.x build and PHP7

  • PHP Version
  • phalcon
  • Version 2.1.0r
  • Powered by Zephir Version 0.9.2a-dev
  • nginx + php-fpm

simple script:

$config = array(
    "host" => "localhost",
    "dbname" => "testbase",
    "port" => 3306,
    "username" => "testbase",
    "password" => "testbase"
use Phalcon\Di\FactoryDefault;
$di = new FactoryDefault();
$di->set('db', function() use ($config) {
    return new \Phalcon\Db\Adapter\Pdo\Mysql([
        "host"     => $config['host'],
        "username" => $config['username'],
        "password" => $config['password'],
        "dbname"   => $config['dbname']
$m = TestModel::findFirst();

I see '502 Bad Gateway' error page and nginx log '*956 recv() failed (104: Connection reset by peer) while reading response header from upstream, client:'

edited Mar '16

What do you get with a simple echo "test";?

All tests before last line find or findFirst works normal, but only with die or exit.

I tried recompile few times and update repozitories cpahlcon and zephir, but results the same :(

Is it only my problems?

edited Mar '16

for me, php 7 doesnt work at all, there was one "big: issue with constructors wasnt called which was fixed few days ago, however this problem is probably because of create instance params.

More info:

That is happening to me too! Exactly that!


Most of problems are beacause of zephir. There are zephir repo: There are many PHP 7 issues, and they can occur like really many times. We have to wait until zephir is updated and most of problems on phalcon will be fixed.