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 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭