Title: SyntaxError: Unexpected token &lt; in JSON
Last modified: December 11, 2017

---

# SyntaxError: Unexpected token < in JSON

 *  Resolved [publicstaticjg](https://wordpress.org/support/users/publicstaticjg/)
 * (@publicstaticjg)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-in-json/)
 * This site works perfectly well on local machine (Open Server) and another live
   server running Apache. But Price Calculator fails to load on server running nginx(
   attached link). But I’m not sure if the problem is in the nginx.
 * I get this error in console:
    AWS Price Calculator Error: SyntaxError: Unexpected
   token < in JSON at position 0
 * And if I’m not wrong the AJAX repsonse looks like:
 * <br />
    <b>Warning</b>: Invalid argument supplied for foreach() in <b>/var/www/
   miralls/data/www/miralls.ru/wp-content/plugins/woo-price-calculator/admin/awspricecalculator/
   Helper/CalculatorHelper.php</b> on line <b>180</b><br /> {“errorsCount”:0,”errors”:[],”
   price”:”<span class=\”woocommerce-Price-amount amount\”>27720\u00c2\u00a0<span
   class=\”woocommerce-Price-currencySymbol\”>\u00d1\u0080\u00d1\u0083\u00d0\u00b1.
   <\/span><\/span>”,”outputFields”:”<br\/>”,”conditionalLogic”:{“5″:1,”6″:1,”4″:
   1,”3″:1,”1″:1,”2″:1,”price”:1}}
 * And of couse the response is not a valid JSON object.
 * Any ideas how to fix this issue? (Except of using Apache server)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsyntaxerror-unexpected-token-in-json%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Altos](https://wordpress.org/support/users/sefin/)
 * (@sefin)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-in-json/#post-9775620)
 * Hi publicstaticjg
    This problem has been fixed for next release but in a working
   environment and to solve now the problem he must disable debugging mode of his
   website by setting:
 * define( ‘WP_DEBUG’, false );
 * In /wp-config.php
 * For more information: [https://codex.wordpress.org/Debugging_in_WordPress](https://codex.wordpress.org/Debugging_in_WordPress)
   
   ========== At29
    -  This reply was modified 8 years, 5 months ago by [Altos](https://wordpress.org/support/users/sefin/).
 *  Thread Starter [publicstaticjg](https://wordpress.org/support/users/publicstaticjg/)
 * (@publicstaticjg)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-in-json/#post-9777160)
 * Version 2.1.3 I recieved via e-mail solved this issue. Thanks.

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

The topic ‘SyntaxError: Unexpected token < in JSON’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woo-price-calculator_cbcbcc.svg)
 * [WooPrice Calculator](https://wordpress.org/plugins/woo-price-calculator/)
 * [Support Threads](https://wordpress.org/support/plugin/woo-price-calculator/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-price-calculator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-price-calculator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-price-calculator/reviews/)

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [json](https://wordpress.org/support/topic-tag/json/)
 * [nginx](https://wordpress.org/support/topic-tag/nginx/)

 * 2 replies
 * 2 participants
 * Last reply from: [publicstaticjg](https://wordpress.org/support/users/publicstaticjg/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/syntaxerror-unexpected-token-in-json/#post-9777160)
 * Status: resolved