News:

Wondering if this will always be free?  See why free is better.

Main Menu

opcache in php 7.1.5

Started by spiros, June 05, 2017, 02:51:00 AM

Previous topic - Next topic

spiros

Is it enabled by default? I see:

Quoteopcache.enable_cli   "1"   PHP_INI_SYSTEM   Enabled by default as of PHP 7.1.2
http://php.net/manual/en/opcache.configuration.php

If this is the case, then where would the SMF cache files be and shouldn't SMF detect it and show it in Administration Center » Server Settings » Caching?

Currently I see:
QuoteSMF has not been able to detect a compatible accelerator on your server.

So, I am guessing that Caching Level selection at this point is irrelevant?

digger

Opcache is not data cache. SMF will not use it to cache data.

spiros

So no need or way for data caching in php 7.1 for SMF?

digger

Quote from: spiros on June 05, 2017, 04:14:48 AM
So no need or way for data caching in php 7.1 for SMF?
You can use memcache or apcu for it.

vbgamer45

I recommended memcache works great for me.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor

Quote from: spiros on June 05, 2017, 04:14:48 AM
So no need or way for data caching in php 7.1 for SMF?

PHP doesn't come with a data cache out of the box, and nor should it.

vbgamer45

There is the fill based caching system.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

spiros

Currently in my cache folder I only see files like this:
data_cc8fd1fd82482325b0f4c4ab4eca0932-SMF-httpBL-response-199-21-99-208.php
data_badbehavior-d7671d13.php
data_cc8fd1fd82482325b0f4c4ab4eca0932-SMF-hostlookup-80.106.98.69.php

and content:

Quote<?php if (!defined('SMF')) die; if (1496684991 < time()) $expired = true; else{$expired = false; $value = 'a:11:{s:3:"url";s:31:"/forum/index.php?topic=354920.0";s:10:"user_agent";s:64:"Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)";s:8:"username";N;s:7:"stopped";i:1;s:3:"raw";s:10:"127.0.14.0";s:11:"errorNumber";i:300;s:2:"ip";s:13:"199.21.99.208";s:13:"last_activity";s:1:"0";s:6:"threat";s:2:"14";s:4:"type";s:1:"0";s:13:"search_engine";i:1;}';}?>

vbgamer45

What level caching do you have enabled? The higher the number the more files you will see in tehre.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

spiros

#9
1

But those contents do not look like cached forum pages, they look like httpBL and badbehavior notices. And this is all it is.

Has anyone used APCu with php 7.1? Does it work out of the box and get detected by SMF?

Arantor

The forum never, ever caches entire pages. The content is far too dynamic for that. It has only ever cached data used to rebuild pages.

Those kinds of files look exactly like SMF doing what SMF's file cache does. That hostlookup one you mention is in fact generated by the core under normalish circumstances (slow rDNS return, usually)

APCu is not supported in 2.0, only the original APC extension for PHP is supported. (APCu support does exist in 2.1, though I doubt it's been thoroughly tested)

spiros

Thanks, Arantor; so I guess the only option for SMF 2 and php 7.1 is memcache(d)? But since there are more sites on the VPS it might not be a good idea?

GL700Wing

Quote from: spiros on June 05, 2017, 03:45:39 PMHas anyone used APCu with php 7.1? Does it work out of the box and get detected by SMF?
I've been able to get APCu working with PHP 7.1 and SMF 2.0.14 - see https://www.simplemachines.org/community/index.php?topic=554712.msg3932154#msg3932154

Also, by copying the attached script to the forum directory/folder and opening from there I've been able to confirm that after just six hours the cache hit rate is 65%.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Advertisement: