Title: PHP Warning: unserialize() expects parameter 1 to be string, array given
Last modified: March 9, 2022

---

# PHP Warning: unserialize() expects parameter 1 to be string, array given

 *  Resolved [James Lee](https://wordpress.org/support/users/jameslhc/)
 * (@jameslhc)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given-2/)
 * I’m seeing errors like the ones below in my `error_log` file:
    `PHP Warning: 
   unserialize() expects parameter 1 to be string, array given in wp-content/plugins/
   geodirectory/includes/custom-fields/output-functions.php on line 2290`
 * This line specifically:
    `$extra_fields = stripslashes_deep(unserialize($cf['
   extra_fields']));`
 * I am using a persistent Object Cache (the [Docket Cache](https://wordpress.org/plugins/docket-cache/)
   plugin) which unserialized the values stored in cache so your plugin is unserializing
   it the second time.
 * Maybe changing `unserialize()` to `maybe_unserialize()` will solve the problem?
 * Here’s a reference of the same problem happening to another plugin:
    [https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given/](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given/)

Viewing 1 replies (of 1 total)

 *  [Kiran Prajapati](https://wordpress.org/support/users/kprajapatii/)
 * (@kprajapatii)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given-2/#post-15440155)
 * Hi James,
 * We have changed unserialize() to maybe_unserialize() to prevent PHP warning. 
   It will be updated in next release. Meantime try to re-save address field from
   CPT > Settings > Custom Fields.
 * Thanks,
    Kiran

Viewing 1 replies (of 1 total)

The topic ‘PHP Warning: unserialize() expects parameter 1 to be string, array given’
is closed to new replies.

 * ![](https://ps.w.org/geodirectory/assets/icon-256x256.jpg?rev=2778361)
 * [GeoDirectory - WP Business Directory Plugin and Classified Listings Directory](https://wordpress.org/plugins/geodirectory/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geodirectory/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geodirectory/)
 * [Active Topics](https://wordpress.org/support/plugin/geodirectory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geodirectory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geodirectory/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kiran Prajapati](https://wordpress.org/support/users/kprajapatii/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given-2/#post-15440155)
 * Status: resolved