bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scripts silently die when throwing exception in CLI mode

winternet-studio opened this issue · comments

commented

When you throw an exception (throw new \Exception('Some error...');) in CLI mode the script silently dies without no output to the console. It is only logged in PHP's error log.

That should not be default behaviour I would say.

Btw, this is on Windows. If I run it in my Linux environment it should just fine.

commented

This looks more like a question for the mailing list. (https://groups.google.com/forum/#!forum/f3-framework)

Anyway - have you checked display_errors in your ini file? Note that the cli will typically be using a different ini file to the one used by your webserver.

  • php -r "phpinfo();" | grep php.ini to check for which one it's using.
  • php -d display_errors=on .... to override it anyway.
commented

Yes, display_errors is on. And it works just fine until I initiate the F3 framework...

Btw, this is on Windows. If I run it in my Linux environment it works just fine.

The framework sets ini_set('display_errors',0); on initialization, so I think it should be handle displaying at least any error message if not QUIET turned on.