digitalnature / php-ref

A better alternative to print_r / var_dump
347 stars 59 forks source link

Apache crash with Laravel model #41

Closed danbalarin closed 8 years ago

danbalarin commented 8 years ago

I have issue with php-ref. I used your project in past (it is AWESOME), but now, when i want to display single Model, get by find() or findOrFail() or all()[0] it just crashes apache.

Apache stopped working:
//it is in czech, hope you can translate it or just recognize by any other windows error
Podpis problému:
  Název události problému:   APPCRASH
  Název aplikace:  httpd.exe
  Verze aplikace:   2.4.18.0
  Časové razítko aplikace:   5667f02e
  Název chybného modulu:  php7ts.dll
  Verze chybného modulu:   7.0.1.0
  Časové razítko chybného modulu:   5671ed04
  Kód výjimky:    c0000005
  Posun výjimky:   000fc962
  Verze operačního systému:  6.1.7601.2.1.0.256.49
  ID národního prostředí:   1029
  Další informace 1:  0a9e
  Další informace 2:  0a9e372d3b4ad19135b953a78882e789
  Další informace 3:  0a9e
  Další informace 4:  0a9e372d3b4ad19135b953a78882e789

In Apache log is just that child process stopped working, nothing else, PHP log I can't find and Laravel log is clear. Laravel version: 5.2 php-rev version: dev-master and v1.2, both do same When i use it on anything else, like collection of models or whatever it works, just single model does not work. Hope you will fix soon this so I can use this further, until then I must switch to anything else, but other projects are ugly :/

digitalnature commented 8 years ago

I installed PHP 7.0.8 just for this and I can't reproduce your crash. I used laravel's Task example model, sqlite connection and did a listing on ->all()

danbalarin commented 8 years ago

Well, I tried it again, after two weeks, with the same setup, only updated (symfony, laravel etc.) and now it works. I am sure that it was caused by this plugin (when i commented it out, it worked) or related to this but I'm glad it works. Sorry for your time :/

ghost commented 7 years ago

Same here

2017/04/11 19:39:00 [error] 3252#0: *2257 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 81.2xx.xx.1xx, server: domain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9005", host: "domain.com", referrer: "http://domain.com/"

any help pls ?

ghost commented 7 years ago

its only crashing when the 'showMethods' is set to true...

when i set it to false the crash is gone but it will not display the methods..

ghost commented 7 years ago

i just fixed it by replacing

if (static::$env['is546'] && !$parameter->getDeclaringFunction()->isInternal() && $parameter->isDefaultValueConstant()) {
    $this->fmt->text('constant', $parameter->getDefaultValueConstantName(), 'Constant');

} else {
    $this->evaluate($paramValue, true);
}

with

$this->evaluate($paramValue, true);

here https://github.com/digitalnature/php-ref/blob/master/ref.php#L1983