jokkedk/webgrind

PHP Errors after install on Mac OS

wayheming opened this issue · 3 comments

Hello, after installation I can not run webgrind on Mac https://gyazo.com/5566e4178dae231b840e125a82663f16

Warning: fread(): Length parameter must be greater than 0 in /Users/ernestbeginov/Sites/webgrind/library/Reader.php on line 255
Notice: Undefined index: events in /Users/ernestbeginov/Sites/webgrind/library/Reader.php on line 218

My xdebug config:
[xdebug]
zend_extension="xdebug.so"
xdebug.mode=profile
xdebug.client_host=127.0.0.1
xdebug.output_dir = "/Users/ernestbeginov/Sites/woodmart/xdebug"
xdebug.profiler_append=1

I have been trying to use fix form this issue #127 and #6 but in not helped me.

Having the same issue on a linux system. Using the newest xdebug and webgrind versions.

Ah, I found the source of the problem. By default, cachegrind files are compressed by xdebug >= 3.1. This is not supported by webgrind as it seems. Unzipping the file fixes the issue. Maybe this should be documented.

Source of the following text: https://xdebug.org/docs/profiler#use_compression

boolean xdebug.use_compression = true #
Introduced in Xdebug >= 3.1

If enabled, the Function Trace and Profiling features will create GZip compressed files as output. This reduces diskspace.

If GZip compression is not supported by Xdebug, because it was not compiled in, then Xdebug will add a warning to its log and xdebug_info() diagnostics section.

It is enabled by default if Xdebug has GZip support, and disable if Xdebug does not have GZip support.

The QCacheGrind tool that you can use to visualise profiling information does not support reading GZip compressed profile files, whereas KCacheGrind and PhpStorm do. If you are a QCacheGrind user, you should set xdebug.use_compression to false.

@oneserv-heuser oO, it's working thank you very much.

@wayheming So I think you can close this issue as there is already a feature request: #139