Title: PHP error &#8220;trying to access array offset&#8221;
Last modified: January 26, 2022

---

# PHP error “trying to access array offset”

 *  Resolved [fhwebdesign](https://wordpress.org/support/users/fhwebdesign/)
 * (@fhwebdesign)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-trying-to-access-array-offset/)
 * Hi there,
 * I just noticed the following error in my apache log:
    [26-Jan-2022 14:02:05] 
   WARNING: [pool xxx] child 774611 said into stderr: “PHP message: PHP Warning:
   Trying to access array offset on value of type bool in /xxx/wp-includes/media.
   php on line 785” Also, there the same erro message for other lines.
 * So I cloned my website, deactivated all plugins, switched theme to twenty twentytwo
   and tried again.
    The error still persists.
 * As I am using Plesk with WP-Toolkit extension, I used that to verify the checksums
   of the wordpress and verify their integrity. The checksums are correct.
 * So I used WP-Toolkit to reinstall the wordpress core. It has done without any
   errors.
    But still, the warning above exists.
 * A completely new WordPress installation does not throw this warning.
 * Any ideas what I can check further?
    -  This topic was modified 4 years, 4 months ago by [fhwebdesign](https://wordpress.org/support/users/fhwebdesign/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [benjamin](https://wordpress.org/support/users/berksted/)
 * (@berksted)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-trying-to-access-array-offset/#post-15293774)
 * Hi,
 * A PHP warning message like will not break the site but there is some code doing
   something unapproved (i.e. not checking for the existence of a value).
 * What version of PHP are you using and is there any difference between the two
   systems? A newer version maybe more strict.
 * Ben
    -  This reply was modified 4 years, 4 months ago by [benjamin](https://wordpress.org/support/users/berksted/).
 *  Thread Starter [fhwebdesign](https://wordpress.org/support/users/fhwebdesign/)
 * (@fhwebdesign)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-trying-to-access-array-offset/#post-15293784)
 * Hi [@berksted](https://wordpress.org/support/users/berksted/) ,
    thanks for your
   answer. I know it won’t do anything worse – but I want my logs clean, not growing
   and easier for real error investigation.
 * I’m using PHP 8.0 on both sites, they are hosted on the same server.
 *  [benjamin](https://wordpress.org/support/users/berksted/)
 * (@berksted)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-trying-to-access-array-offset/#post-15293829)
 * Hi,
 * Right now php 8 is in beta support, so that might be the issue.
 * [https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/](https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/)
 * You can turn off those notifications for the time being ( I know this is not 
   the optimal solution).
 * [https://www.php.net/manual/en/function.error-reporting.php](https://www.php.net/manual/en/function.error-reporting.php)
 * ben
 *  Thread Starter [fhwebdesign](https://wordpress.org/support/users/fhwebdesign/)
 * (@fhwebdesign)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-trying-to-access-array-offset/#post-15293914)
 * Hi,
    seems like that is the solution. With PHP7.4, the warning is not shown. 
   Thanks!
 * PS: I wonder why the fresh installation of WP with PHP 8.0 is not running into
   this warning…
 *  [benjamin](https://wordpress.org/support/users/berksted/)
 * (@berksted)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-trying-to-access-array-offset/#post-15294800)
 * Hi,
 * Hmmm… not sure, do you have the content/images loaded in the fresh install? In
   that part of the code, it’s trying to fetch an image.
 * Ben
 *  Thread Starter [fhwebdesign](https://wordpress.org/support/users/fhwebdesign/)
 * (@fhwebdesign)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-trying-to-access-array-offset/#post-15294829)
 * No, there are no images and pages/posts loaded.
    Maybe there could be the problem.
   But how do I detect the detailled problem?
 *  [benjamin](https://wordpress.org/support/users/berksted/)
 * (@berksted)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-trying-to-access-array-offset/#post-15294899)
 * Hi,
 * Updated. Might be best to file a bug report as that line (785) is not handling
   the operation correctly.
 * Ben
    -  This reply was modified 4 years, 4 months ago by [benjamin](https://wordpress.org/support/users/berksted/).
    -  This reply was modified 4 years, 4 months ago by [benjamin](https://wordpress.org/support/users/berksted/).
    -  This reply was modified 4 years, 4 months ago by [benjamin](https://wordpress.org/support/users/berksted/).

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘PHP error “trying to access array offset”’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [benjamin](https://wordpress.org/support/users/berksted/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-trying-to-access-array-offset/#post-15294899)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
