duangutian1426 2013-12-17 19:42
浏览 77
已采纳

JSON常量表示它们在Ubuntu的PHP 5.5中未定义

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!

  • 写回答

1条回答 默认 最新

  • donglin6109 2013-12-17 19:46
    关注

    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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题