Skip to main content
Topic: Some errors with PHP 7.2 and Elkarte 1.1.3 (Read 9702 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Some errors with PHP 7.2 and Elkarte 1.1.3

There are some active topics with reported errors in elkarte log, I'll try to post only the ones there aren't reported, sorry if I'll report something that was already reported.

from members:
Code: [Select]
    Type of error: General
    Warning: filesize(): stat failed for /public/cache/data__a02fe4740023f74aa19cdfc21c227202-ELK-permissions-0,7.php
   /index.php?board=3.0
    File: /public/sources/subs/CacheMethod/Filebased.php
    Line: 105

Code: [Select]
    Type of error: Undefined
    Exception: Call to undefined function hasTopicNotification()
    index.php?action=notify;topic=6418.0
    File: /public/sources/controllers/Notify.controller.php
    Line: 68

from a guest:
Code: [Select]
     Guest
    Type of error: General
    Warning: file_get_contents(/public/cache/data__a02fe4740023f74aa19cdfc21c227202-ELK-permissions--1.php): failed to open stream: No such file or directory
/index.php?action=dlattach;topic=4604.0;attach=37617;image
    File: /public/sources/subs/CacheMethod/Filebased.php
    Line: 107

from a guest:
Code: [Select]
    no_session_data
    Type of error: Critical
    The database value you're trying to insert does not exist: group_list
    Function: boardsAllowedTo
  /index.php?action=dlattach;attach=1334;type=avatar
    File: /public/sources/Security.php
    Line: 1231

from a guest:
Code: [Select]
    Type of error: Undefined
    Notice: Undefined index: actual_theme_dir
   index.php?action=register;sa=usernamecheck;xml;username=MauroK
    File: /public/sources/Load.php
    Line: 2454

from my account:
Code: [Select]
    Type of error: General
    Notice: A non well formed numeric value encountered
   index.php?action=profile;area=statistics;u=1
    File: /default/ProfileInfo.template.php
    Line: 445

from a member:
Code: [Select]
    Type of error: General
    Warning: array_merge(): Argument #2 is not an array
   /index.php?action=dlattach;topic=11490.0;attach=43454;image
    File: /public/sources/subs/Cache.class.php
    Line: 119

from member:
Code: [Select]
    Type of error: General
    Notice: Trying to get property 'expiration' of non-object
    /index.php?action=dlattach;topic=11490.0;attach=43458;image
    File: /public/sources/subs/CacheMethod/Filebased.php
    Line: 109

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #1

snicker .... radu81 uses filebased caching ... snicker :P

Thanks for the reports, looks like @emanuele has been busy  O:-)

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #2

I've done some tests on a test vps and I was able to install and use memcached. Should I use it instead of filebased cache?

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #3

Well php7.2 already have opcache which you can use but installing and using memcached won't hurt, I think.

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #4

The OpCache is really for storing "precompiled " versions of the php scripts.  Precompiling removies the need for PHP to load and parse scripts on each request.

memcached saves user "data"  ... results of user and common db queries.   This reducers the load on the database, maybe some other benefits buts that is basically it ... Most of that data is cached for say 30 - 120 seconds, some shorter some longer, but that is the scope of the benefit.  So useful if you have a somewhat active site, otherwise probably neutral or a minor determent.

memcached is a good choice as is apcu for filling the user data purpose.   Filebased can be a help, better if you are using ssd's.  We could improve the filebased somewhat but I've never felt it was the best solution for standard shared or basic vps setups (thats an IMO) so I've stuck with memcached or apcu.

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #5

The last was already reported (and fixed somewhere by @Spuds I think), the others are now tracked.

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #6

I have a fix for the last one in my repo ... now I've installed 7.2 on my local as well  :'(

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #7

Another one: if I select all topics from Recycle board and then I delete them I get "  Call to undefined function updateMemberData()" error. The topics are deleted from Recycle board.

Code: [Select]
    Type of error: Undefined
    Exception: Call to undefined function updateMemberData()
    /index.php?action=quickmod;board=15.0
    File: /sources/subs/Likes.subs.php
    Line: 1156

 

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #8

Adding
Code: [Select]
require_once(SUBSDIR . '/Members.subs.php');

Just before the foreach should solve that issue.

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #9

@radu could you please open a new topic when you report a new bug? Otherwise it may be lost. :)

I thought this one was in extermineted...never mind.


Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #11

there is more than one foreach in Likes.subs.php, where exactly should I add that?


Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #13

Why not use Database caching ?
Wie have implemented that and it's much faster the Filecache (5x)
Speed in the oder:
APCU
MemCached
Database caching
File based caching

If you have PHP 7.2  Opcode caching and your Hoster allowed that, you can use this also as custom cache .. very fast !!

Fel

Re: Some errors with PHP 7.2 and Elkarte 1.1.3

Reply #14

TBH, in most of the cases, anything is faster than file-based caching.
Even non-cached code (actually verified in live servers).
Anyway I don't plan to spend much time on the caching code, I'd prefer at some point to swap it for some maintained library.

Anyway:
https://addons.elkarte.net/enhancement/MySQL-cache.html
https://addons.elkarte.net/enhancement/PostgreSQL-cache.html
thanks to @tino :D