J3 Issue ?
avatar f-hamel
f-hamel
19 Mar 2018

Hello,

I am not really new with Joomla!. But this is my first issue here and also the first time that I am contributing to this project.
So I am sorry for my bad English and please be patiently with me if I get something wrong.

It's not possible to choose apc as session handler if you are running php >= 7.0
I think this is caused by libraries/vendor/joomla/session/Joomla/Session/Storage/Apc.php,
which this function has for detecting apc/apcu:

public static function isSupported()
        {
                return extension_loaded('apc');
        }

To support php >= 7.0 it should be:

public static function isSupported()
        {
                return extension_loaded('apcu');
        }

Or we need an extra handler like already done in Joomla 4 with libraries/vendor/joomla/session/src/Handler/ApcHandler.php

Best regards
Felix

avatar f-hamel f-hamel - open - 19 Mar 2018
avatar joomla-cms-bot joomla-cms-bot - change - 19 Mar 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Mar 2018
avatar f-hamel f-hamel - change - 19 Mar 2018
Title
Session handler apc not available with PHP >= 7.0
[3.8.6]Session handler apc not available with PHP >= 7.0
avatar f-hamel f-hamel - edited - 19 Mar 2018
avatar f-hamel f-hamel - change - 19 Mar 2018
Title
[3.8.6]Session handler apc not available with PHP >= 7.0
[3.8.6] Session handler apc not available with PHP >= 7.0
avatar f-hamel f-hamel - edited - 19 Mar 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Mar 2018
Category Libraries
avatar mbabker
mbabker - comment - 19 Mar 2018

PHP's ext/apc and ext/apcu are two separate things, so yes, a separate handler for the APCu extension would be needed to work specifically with the newer APCu extension.

The original APC extension was in essence deprecated and abandoned at PHP 5.5 in favor of OPCache and APCu became the de facto continuation of this. IIRC there is still an apcu-bc package on PECL that can proxy the old apc_* functions to apcu_* but even that would never make the extension_loaded('apc') check pass.

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Mar 2018
Status New Discussion
avatar f-hamel
f-hamel - comment - 19 Mar 2018

Thanks for the quick answer. So I guess this will be little bit more complicated as I thought.
I have a few question, to understand the whole thing.

As far as I understand, we do need new handler, because all apc_*functions need to be rewritten in to apcu_* . As far as I know they should have a quite similar syntax or even the same?
The new handler need also to check apcu by extension_loaded('apcu').

Would we really need two handler apc and apcu? Why not only support apcu, if apc is deprecated? Is this to be compatible with PHP < 5.5?

avatar mbabker
mbabker - comment - 19 Mar 2018

The APC handler has been there for a long time, and will be dropped in 4.0 since support for that extension is dead. We just never got around to adding an APCu handler in the session API (it was done for the cache API though). And as you found, in the Framework's Session package we did clean things up and make a proper APCu handler.

So honestly it's just one of those things where nobody did the work to add that support.

Would we really need two handler apc and apcu? Why not only support apcu, if apc is deprecated? Is this to be compatible with PHP < 5.5?

If I'm not mistaken PHP's ext/apc is only supported on PHP 5.3 and 5.4, while ext/apcu is PHP 5.5+. IIRC there's also an extension on PECL that can bridge APC to APCu on PHP 5 (maybe even "trick" the extension_loaded() check) but I don't recall if that extension works on PHP 7. Either way migrating APC to APCu is the right course of action, this is just the one area it wasn't done in for whatever reason.

avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar mbabker mbabker - change - 25 Mar 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-03-25 19:10:56
Closed_By mbabker
avatar mbabker
mbabker - comment - 25 Mar 2018

See #19990

avatar mbabker mbabker - close - 25 Mar 2018

Add a Comment

Login with GitHub to post a comment