Title: Error when I am using PHP 7.2
Last modified: February 16, 2018

---

# Error when I am using PHP 7.2

 *  Resolved [Abhishek](https://wordpress.org/support/users/abhishe11sharma/)
 * (@abhishe11sharma)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/error-to-using-php-7-2/)
 * Hi WordPress Experts
 * When I enable PHP 7.2 on my VPS, then I get Warning: count(): Parameter must 
   be an array or an object that implements Countable in /home/*******/*****.com/
   wp-includes/media.php on line 1206
 * Please tell me what should I do?
 * Thanks
    -  This topic was modified 8 years, 3 months ago by [Abhishek](https://wordpress.org/support/users/abhishe11sharma/).

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

 *  [Konstantinos Xenos](https://wordpress.org/support/users/xkon/)
 * (@xkon)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/error-to-using-php-7-2/#post-9980393)
 * This issue was brought up in [Trac Issue 43201](https://core.trac.wordpress.org/ticket/43201)
   and has been fixed as it seems, but it will be implemented on the next update.
 * Now to fix it you’ll either have to:
 * 1] Fall back into a previous PHP version to see if it is ok until the update 
   arrives if possible.
 * 2] (This is not usually the way to do things or propose, as tampering with core
   files can easily break things bu in your case I don’t see another option) Edit
   the media.php file on line 1206 and change:
 * from:
 * `if ( ! $src_matched || count( $sources ) < 2 ) {`
 * to:
 * `if ( ! $src_matched || ! is_array( $sources ) || count( $sources ) < 2 ) {`
 * Make sure to keep a backup of your `media.php` in either way to be safe.
 *  Thread Starter [Abhishek](https://wordpress.org/support/users/abhishe11sharma/)
 * (@abhishe11sharma)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/error-to-using-php-7-2/#post-10114349)
 * Hi Mr. Xenos (xkon) Konstantinos
 * Thanks it’s work for me.

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

The topic ‘Error when I am using PHP 7.2’ is closed to new replies.

## Tags

 * [PHP 7.2](https://wordpress.org/support/topic-tag/php-7-2/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Abhishek](https://wordpress.org/support/users/abhishe11sharma/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/error-to-using-php-7-2/#post-10114349)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
