Title: json_encode issue on PHP
Last modified: August 21, 2016

---

# json_encode issue on PHP

 *  Resolved [krider2010](https://wordpress.org/support/users/krider2010/)
 * (@krider2010)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/json_encode-issue-on-php/)
 * Hi,
 * The recent new version broke on PHP installs before 5.3…
 *     ```
       <br />
       <b>Warning</b>:  json_encode() expects exactly 1 parameter, 2 given in <b>.../wp-content/plugins/json-api/singletons/response.php</b> on line <b>40</b><br />
       ```
   
 * (Which when it’s supposed to be returning a JSON response rather than HTML causes
   some interesting issues 🙂 )
 * I was able to fix it short term by editing the plugin and removing the second
   parameter, but I expect others to come across this, and also don’t want to have
   to make the fix each time the plugin is updated.
 * Cheers!
 * [http://wordpress.org/extend/plugins/json-api/](http://wordpress.org/extend/plugins/json-api/)

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

 *  Plugin Author [dphiffer](https://wordpress.org/support/users/dphiffer/)
 * (@dphiffer)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/json_encode-issue-on-php/#post-3866000)
 * Hi krider2010, thanks for the bug report. This is fixed in version 1.1.0.
 * The next release will suppress PHP warnings so that the JSON output doesn’t get
   messed up when, for example, WP_DEBUG is enabled.
 *  Thread Starter [krider2010](https://wordpress.org/support/users/krider2010/)
 * (@krider2010)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/json_encode-issue-on-php/#post-3866004)
 * Brilliant – thank you! Fantastic response time 🙂
 *  [wanula](https://wordpress.org/support/users/wanula/)
 * (@wanula)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/json_encode-issue-on-php/#post-3866067)

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

The topic ‘json_encode issue on PHP’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-api.svg)
 * [JSON API](https://wordpress.org/plugins/json-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-api/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [wanula](https://wordpress.org/support/users/wanula/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/json_encode-issue-on-php/#post-3866067)
 * Status: resolved