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

Core dumped on Retrieving ResultSet using bind parameters

Hello,

Just working through the documentation (like what I see (thank you!)) and specifically https://docs.phalcon.io/en/latest/reference/models.html#model-resultsets so first tried:

return EntitiyRole::findFirstById($id);

and that works.

Tried

return EntityRole::find();

And works - I get records back.

Then tried:

return EntityRole::find([
                "conditions" => "id = ?1",
                "bind" => [
                    1 => $id
                ],
                "bindTypes" => [Column::BIND_PARAM_INT],
                "hydration" => Resultset::HYDRATE_OBJECTS
            ]);

and my docker console tells me (SIGILL - core dumped)

Tried the object-oriented way:

return EntityRole::query()
            ->where('id = :id:')
            ->bind(['id' => 1])
            ->execute();

core dumped

Tried same idea as documentation:

return EntityRole::find(
            [
                "type = 'power'"
            ]
        );

I don't get a core dump but I don't get a record back. (Checking my sql logger: SQL syntax is correct and I should get a record back).

So if it is id it REALLY does not like it. If using a syntax other than findFirstByFieldName I don't get a ResultSet back.

Please advise - thank you.

Which PhalconPHP version, PHP version, SAPI used?



588

Morning,

  1. PhalconPHP: Docker phalconphp/php-fpm:7-min v3.0.4
  2. PHP: 7.0.16
  3. SAPI: Not sure what you mean.
  4. Nginx: 1.10.1
  5. MySQL: 5.7.18
  6. Redis: 3.2-alpine
  7. Beanstalkd: 1.10

I used: https://phalcon-compose.readme.io/docs to create my environment.

Thank you,

[OffTopic]

SAPI stands for server API, which is php-fpm for you :]

The "server" part is a bit misleading, because php-cli is considered a SAPI too.

[/OffTopic]



588
Accepted
answer

I downloaded the official phalcon docker version https://phalcon-compose.readme.io/docs/getting-started and checked its phpinfo() with my nginx docker phpinfo() and saw I was missing some PHP extensions.

Corrected the missing extensions and re-ran above code snippets - no issues.

In short - incomplete docker setup and not a Phalcon issue - my apologies.

Thanks to all who took a look.