When I turn on “hhvm” on Homestead, I don't ge

2019-07-23 17:48发布

问题:

I am using homestead as my development environment, I turned on the hhvm option for the site

sites:
- map: homestead.app
  to: /home/vagrant/Code/wheremyprojectis
  hhvm: true

I found that when there is an exception, everything is fine, but If I forgot to use namespace, got syntax error in the blade templates, I got nothing, blank page. I go check the logs and still nothing, the debug option is true. It's quite frustrating until I turned off the hhvm option.

I know it is not a big deal, but I still want to know is there any way to fix this?

回答1:

I experienced the same problem. I searched around and found that it seems to be intentional:

  • https://github.com/facebook/hhvm/issues/4818
  • https://github.com/facebook/hhvm/issues/2571

Now you can poke through the github issues mentioned above, as well as these stackoverflow questions:

  • Display fatal/notice errors in browser
  • hhvm-fastcgi + nginx how to make it display fatal errors in the browser
  • laravel 5 show blank page on server error (and no laravel log), running with hhvm and nginx

For the time being, it ultimately boils down to writing your own handler, which isn't too bad. You can also tail the errors at /var/log/hhvm/error.log. Any errors that you intentionally want going to the browser you could of course handle using Laravel's error handling and logging.

UPDATE:
I reported this issue(and a fix) to the Laravel github here:

https://github.com/laravel/framework/issues/8744



标签: hhvm