amnuts / opcache-gui

A clean, effective and responsive interface for Zend OPcache
1.21k stars 197 forks source link

Undefined index: interned_strings_usage #26

Closed lourdas closed 6 years ago

lourdas commented 6 years ago

I just downloaded version 2.3.0 and when I access it, I get this error:

Notice: Undefined index: interned_strings_usage in /home/xxxx/public_html/opcache-gui-2.3.0/index.php on line 190

I have display_errors set to on and error_reporting is set to E_ALL in php. It seems that a check must first be done before accessing this attribute.

lourdas commented 6 years ago

It seems that opcache_get_status() in my system does not return information about interned strings buffer. I'm investigating...

amnuts commented 6 years ago

What version of PHP and Zend OPCache are you running?

lourdas commented 6 years ago

It's 7.0.21 in my Gentoo box.

lourdas commented 6 years ago

I suspect there's some kind of compilation flag that is involved in returning information about interned strings, because I have the same behaviour in my server, which is also running Gentoo and 7.0.21.

lourdas commented 6 years ago

I suspect that this is due to the fact that PHP is compiled with threads in my system. I'm recompiling now and will check again.

lourdas commented 6 years ago

Yes, that is the case. Recompiling with threads disabled solves the issue.

Maybe a condition to check for thread safety, so that in such a case, no interned strings usage should be displayed?

amnuts commented 6 years ago

Give commit 0e531d677091a63fd02b1ddfbf030c75e07eda68 (the fix-interned-strings branch) a shot. It will only show the interned strings panel if that data is available and won't throw notices about it.

amnuts commented 6 years ago

Have gone ahead and merged this anyway - it all seemed fine to me.