سؤال

I am running an API library on my server running PHP 5.5.3 and when I try and fire a request I get a notice saying that JSON_HEX_TAG, JSON_HEX_APOS, JSON_HEX_QUOT, and JSON_HEX_AMP are not defined.

Notice: Use of undefined constant JSON_HEX_QUOT - assumed 'JSON_HEX_QUOT' in /path/to/library/SendGrid/Email.php on line 303

From what I have read it sounds like these should be there on any PHP version 5.3 or above. This is an Ubuntu box running Nginx, PHP-FPM, and PHP 5.5. Any thoughts why these would keep coming up? Thank you!

هل كانت مفيدة؟

المحلول

The Debian maintainers (which Ubuntu is based on), in their great wisdom of Open Source licenses, took offense with the JSON license that "this shall only be used for good, not evil", and so excluded it from the PHP compile.

You can install it by explicitly installing php5-json.

sudo apt-get install php5-json
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top