MyBB Community Forums

Full Version: Undefined offset
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
My eror_log is getting huge with undefined offsets, indexes and variables

Mostly plugins
but here by mybb as well
latest mybb 1.8.24

[25-Jan-2021 16:08:42 UTC] PHP Notice:  Undefined offset: 4 in /forum/inc/functions.php on line 1474
What's the cache storage (or cache handler) for your forum? db or something else? You may check that in the forum's configuration file ./inc/config.php.
(2021-01-27, 08:56 AM)noyle Wrote: [ -> ]What's the cache storage (or cache handler) for your forum? db or something else? You may check that in the forum's configuration file ./inc/config.php.

Db
as per config 

$config['cache_store'] = 'db';

Forum url

http://alhimika.net/forum/
800mb by now since my first post
this is not normal
Are you by chance using PHP 8? I know there are some PHP 8 issues that have been patched on Github, but have not had a release yet.
(2021-01-29, 12:11 AM)dragonexpert Wrote: [ -> ]Are you by chance using PHP 8?  I know there are some PHP 8 issues that have been patched on Github, but have not had a release yet.

no it's 7.3, but I believe 7.0 was same thing. I have to double check

same thing with 7.0
Same trouble here. Error log is growing extremely fast by filling with "PHP Notice:  Undefined offset: " and "PHP Notice:  Undefined variable:" and "PHP Notice:  Undefined index:" entries.
This is probably due to a bad-coded plugin, where array indexes aren't protected.

You didn't give us the relevant part of your errors: where are located the undefined offsets, or which is the file calling the faulty function.
(2021-02-01, 01:18 PM)Crazycat Wrote: [ -> ]This is probably due to a bad-coded plugin, where array indexes aren't protected.

You didn't give us the relevant part of your errors: where are located the undefined offsets, or which is the file calling the faulty function.
Can you more lengthy error log later on. 
Will not be able to upload 1gb error log though 😂
But today and tomorrow I am changing my hosting provider so later on

Hi Guys!
Still in the process of changing hosting provider, but realistically I see only two options

For me it doesn't matter if this is plugin or not. For me all plugins I'm using are the must. Since without them MyBB rolling back somewhere into mid 90s.

So either amending php.ini
error_reporting = E_ALL & ~E_NOTICE
Something I tried with my old hoster, but it looks I have no rights for this and hoster technical support is pretty much a joke.

Another possible option is to amend MyBB php files by adding
<?php error_reporting (E_ALL ^ E_NOTICE); ?>
Which php file should I add this?
I hope not every single file
as an update
adding
error_reporting (E_ALL ^ E_NOTICE);

To
index.php
worked like a charm..... so far

(2021-02-01, 07:41 AM)tom762 Wrote: [ -> ]Same trouble here. Error log is growing extremely fast by filling with "PHP Notice:  Undefined offset: " and "PHP Notice:  Undefined variable:" and "PHP Notice:  Undefined index:" entries.

Hi! 

Get this line
php error_reporting (E_ALL ^ E_NOTICE);

into your index.php and you'll be sorted once and for all
Does the job till developers change their coding practices
Pages: 1 2