Hello list,
Today I am facing a rather strange PHP error message on a production system
using PHP 5.4.41 with APC:
[09-Jul-2015 15:06:43 Europe/Brussels] PHP Fatal error: Access to
undeclared static property:
Stash\Item::$/opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Interfaces/ItemInterface.php
in /opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Item.php
on line 348
That line 348 is this one:
https://github.com/tedious/Stash/blob/master/src/Stash/Item.php#L348
and contains:
$cacheTime = self::$cacheTime;
$cacheTime being defined in the class as:
public static $cacheTime = 432000; // five days
(see: https://github.com/tedious/Stash/blob/master/src/Stash/Item.php#L59)
A message like:
"Fatal error: Access to undeclared static property:
Stash\Item::$cacheTime" is virtually possible, but:
"Fatal error: Access to undeclared static property:
Stash\Item::$/opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Interfaces/ItemInterface.php"
?
How is it possible that the filename of the file containing the interface
being used by that class appears instead of the variable?
Any clue of what happened? PHP bug, APC one? Memory corruption? Bad karma
or planets wrongly aligned?
Cheers,
Patrick
Hi Patrick
Any clue of what happened? PHP bug, APC one? Memory corruption? Bad karma
or planets wrongly aligned?
At first it sounds like an APC issue, is it reproducible without? APC
never fully supported 5.4 and onwards besides a few changes here and
there, so it could also be a coverage issue.
--
regards,
Kalle Sommer Nielsen
kalle@php.net
Hi Kalle,
Le jeu. 9 juil. 2015 à 17:30, Kalle Sommer Nielsen kalle@php.net a écrit :
Hi Patrick
Any clue of what happened? PHP bug, APC one? Memory corruption? Bad karma
or planets wrongly aligned?At first it sounds like an APC issue, is it reproducible without? APC
never fully supported 5.4 and onwards besides a few changes here and
there, so it could also be a coverage issue.
APC bug was my initial conclusion. Unfortunately, the system exists in
production for 2/3 years now without big changes since then. That is just
the first time we encountered that issue.
We rebooted the Apache and cleaned the files generated by Stash (caching
library). The (symptoms of the) error disappeared but we can't guarantee it
doesn't come back in some days or years.
It is certainly not easily reproducible. One thing is sure is that the
error message is completely bogus.
APC 3.1.13 is the version used.
Cheers,
Patrick
Hi Patrick.
Am 09.07.15 um 16:58 schrieb Patrick ALLAERT:
Hello list,
Today I am facing a rather strange PHP error message on a production system
using PHP 5.4.41 with APC:[09-Jul-2015 15:06:43 Europe/Brussels] PHP Fatal error: Access to
undeclared static property:
Stash\Item::$/opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Interfaces/ItemInterface.php
in /opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Item.php
on line 348That line 348 is this one:
https://github.com/tedious/Stash/blob/master/src/Stash/Item.php#L348
and contains:
$cacheTime = self::$cacheTime;$cacheTime being defined in the class as:
public static $cacheTime = 432000; // five days
(see: https://github.com/tedious/Stash/blob/master/src/Stash/Item.php#L59)A message like:
"Fatal error: Access to undeclared static property:
Stash\Item::$cacheTime" is virtually possible, but:
"Fatal error: Access to undeclared static property:
Stash\Item::$/opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Interfaces/ItemInterface.php"
?How is it possible that the filename of the file containing the interface
being used by that class appears instead of the variable?Any clue of what happened? PHP bug, APC one? Memory corruption? Bad karma
or planets wrongly aligned?
Bad Parameter handling? Or am I missing the declaration of the
$cacheTime Variable in or before the else-block?
So efectively you assign $cacheTime = self::void
Not sure whether that's a good idea in the first place.... ;)
Cheers
Andreas
Cheers,
Patrick
--
,,,
(o o)
+---------------------------------------------------------ooO-(_)-Ooo-+
| Andreas Heigl |
| mailto:andreas@heigl.org N 50°22'59.5" E 08°23'58" |
| http://andreas.heigl.org http://hei.gl/wiFKy7 |
+---------------------------------------------------------------------+
| http://hei.gl/root-ca |
+---------------------------------------------------------------------+
Hi Andreas,
Le jeu. 9 juil. 2015 à 17:35, Andreas Heigl andreas@heigl.org a écrit :
Hi Patrick.
Am 09.07.15 um 16:58 schrieb Patrick ALLAERT:
Hello list,
Today I am facing a rather strange PHP error message on a production
system
using PHP 5.4.41 with APC:[09-Jul-2015 15:06:43 Europe/Brussels] PHP Fatal error: Access to
undeclared static property:Stash\Item::$/opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Interfaces/ItemInterface.php
in /opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Item.php
on line 348That line 348 is this one:
https://github.com/tedious/Stash/blob/master/src/Stash/Item.php#L348
and contains:
$cacheTime = self::$cacheTime;$cacheTime being defined in the class as:
public static $cacheTime = 432000; // five days
(see:
https://github.com/tedious/Stash/blob/master/src/Stash/Item.php#L59)A message like:
"Fatal error: Access to undeclared static property:
Stash\Item::$cacheTime" is virtually possible, but:
"Fatal error: Access to undeclared static property:Stash\Item::$/opt/app/a373/apache-pro/htdocs/vendor/tedivm/stash/src/Stash/Interfaces/ItemInterface.php"
?
How is it possible that the filename of the file containing the interface
being used by that class appears instead of the variable?Any clue of what happened? PHP bug, APC one? Memory corruption? Bad karma
or planets wrongly aligned?Bad Parameter handling? Or am I missing the declaration of the
$cacheTime Variable in or before the else-block?
There is two things: $cacheTime as a local variable to that function. And
self::$cacheTime that has nothing to do with the local variable and
that is declared at the top of the class.
So efectively you assign $cacheTime = self::void
Nope, and "I" am not, Stash is a commonly used 3rd party caching library.
Not sure whether that's a good idea in the first place.... ;)
Cheers
Andreas
Cheers,
Patrick