Could anyone give me a exact steps on how to get APC (using apcu) Plugin working on PHP 7 +

I am running Elgg 2.3.12 using PHP 5.6 with working APC Cache (APCU), OPCache, Memcache, and Redis. All is working fine. I am using APC OpCache Tools Plugin found at url https://elgg.org/plugins/2880496 for APC & OpCache.

I want to upgrade php from 5.6 to 7.0 or preferably 7.2
When I do so, I loose the APC Flush Button on Admin Panel. OPCache Flush button remains. FYI both the APC Flush and OpCache is buddled into one plugin that is APC OpCache Tools Plugin found at url https://elgg.org/plugins/2880496. So unable to figure out what needs to be done. I tried to solve this problem for quite sometimes now and have come to conclusion that the fix is beyond me.

Anyone who has APC Flush working abobe php 5.6, kindly please advise what are the exact steps in fixing this problem. I would really appreciate kind assistance.

  • Further to the above, please be advised that in Elgg Git repository this problem is tackled through www.elgg.org , and community plugin. I have looked into it, but couldn't incorporate the solution, although APC OpCache Tools Plugin found at url https://elgg.org/plugins/2880496 is a fusion of original APC Tool Plug and Community.

    So, would really appreciate if some one can give a precious help.

  • Thanks for your reply and the above link. As per PHP (https://www.php.net/manual/en/intro.apc.php)  APC is officially "DEAD", from php 5.6, and recommends using "Alternatives to this extension are OPcache, APCu, Windows Cache for PHP and the Session Upload Progress API. "

    All good and understood. But we have got APC working in php 5.6, and perhaps not to the fullest extend. I mean technically speaking from 5.6 APC should stop functioning as 5.6 doesn't offer APC, instead it offer APCu.

    As I look up the Elgg 2.3 source files for APC it is clear that only reason for it to function in 5.6 is because Elgg has defined APC scope to use APCu data from certain php version, while APCu scope is well defined independently in elgg.

    Please recall my problem which is if I upgrade my PHP from 5.6 to php 7.x I loose, "APC Flush" Button.  The button should have not anything to do with the APC script. *? - Correct ?. Rather it is a Menu Option. *? - Correct ?

    Technically speaking, one can always declare a button but the action script for the said button may work or not and that is completely a separate issue.

    In my case, elgg developer's tool shows the followings for APC under Php 5.6:

    Plugin Hooks:

    register, menu:admin_control_panel 500 (Closure mod/apc_tools/start.php:12)
    500 (Closure mod/apc_tools/start.php:28)


    Action:

    admin/flush_apc mod/apc_tools/actions/admin/flush_apc.php admin only
    admin/flush_memcache mod/apc_tools/actions/admin/flush_memcache.php admin only *
    admin/flush_opcache mod/apc_tools/actions/admin/flush_opcache.php admin only
     

     * perhaps it is possible to similarly register a menu for memcache?

    Menu in Admin Control Panel is declared and Registered with Elgg as Hoock.
    While the APC States registers as under "Menu" - Page

    So, now I have upgraded php  from 5.6 to 7, and still find the above hooks, and action except the button is missing for APC Flush, however the OPCache Flush, button is present and so is the menu for APC States.

    The "Community" plugin which also includes APC Flush and Opcache Flush has been released for 3.x  which is meant to work with php 7x, so I ask again, does it work with php 7x ? If not why is it there? If it works, then it is obvious that the APC Plug that I am using requires review and correction.

    BTW, if I downgrade to php 5.4 the APC Function works flawlessly and all parameters are shown populated in APC Statistic, but for that, Elgg 2.3x Php requirement needs to be downgraded to 5.4, and hypothetically speaking if that is  done I get the followings:

    APC  - Working Independently and Flawlessly
    APCu - works
    Memcache - OK (but there is an issue with memcache and memcached and which memcache_namespace_prefix = memcache.so or memcached.so to use, this is a problem no matter which php version is used, and there are questions if elgg memcache scope is correctly taking advantage of Memcache, and I say that because on the server side Memcache Status shows all parameters are populated however in Elgg Admin Panel Memcache Stats shown 99% of the parameters are not populated.. it just shows pid id value as -1, now PHP supports both memcache & memcached automatically and when memcache option is selected both memcache.so or memcached.so namespace prefix shows up)
    Redis - ok (but there is an issue no matter which php ver is used.. it is recommended that when using Redis two instances of Redis should be used: 1. Redis Persistence = Yes, and 2. 1. Redis Persistence = No). It is not clear from elgg manual which redis instance should be used and dont understand why the namespace for Redis is not declared in setting.php)

    Php 5.4 says "The Alternative PHP Cache (APC) is a free and open "opcode cache" for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code. If enabled, this setting will automatically turn off the Zend Optimizer and the Ion Cube modules for incompatibility reasons. "

    So, I am thinking opcode cache will compensate for OpCache by Zend. Extensions those are going out the window in 5.4 are Zend Optimizer and the Ion Cube modules. So, the question is do we even care about this two extensions, particularly Ion Cube when there are extensions encoder extensions like "ixed" and "

    or should I upgrade php to 7x and change the plugin to register APCu as a Flush Menu with action scipt for APCu Flush instead of APC Flush all together?

    Please advise.

  • I think you need to forget about the deprecated PHP 5.*, APC, suhosin etc.

    Of course, if you have time for this then continue to support the outdated things.

    BTW, OPcache features are in the core now since Elgg 3.0.

    Redis is declared in settings.php since Elgg 3.0 also.

  • @RvR actually you are correct, I do need to forget about APC and move on.

  • @RvR  I am already using this plug. Amazing work. Just amazing.... and i express my appreciation with a salute. EXCELLENT WORK!


     

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.