如何将特定的 PHP 函数添加到我的服务器的 PHP 安装中
我当前运行的是 PHP 版本 5.1.6,但我有一个应用程序大量使用 json_encode
和 json_decode
函数,因此,我想添加将这些函数添加到我的服务器的 PHP 安装中(因为这些函数仅随 PHP 版本 PHP 5.2 + 一起提供)
执行此操作的最佳方法是什么。我对整个终端方法不太失望,所以如果有另一种方法那就太好了
提前非常感谢
I am running PHP version 5.1.6 currently, but I would have an application which makes pretty heavy use of the json_encode
and json_decode
functions, as such, I would like to add these functions to my server's install of PHP (as these functions only ship with PHP versions PHP 5.2 +)
What is the best way of doing this. I'm not too down with the whole Terminal approach so if there was another way that would be great
Many thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您无法升级,请使用 PEAR 的 Services_JSON。它从 PHP 4.3 开始工作,所以你应该没问题。
If you're unable to upgrade, use PEAR's Services_JSON. It works as of PHP 4.3 so you should be fine.
也许您应该在应用程序的根目录中的某个位置调用一个检查器函数,该函数执行 function_exists() 用于您需要的几个函数,如果没有,则停止执行以防止出现不需要的结果。
Maybe you should put somewhere in the root of your application a call to a checker function that does function_exists() for a couple of your needed function and if not stops the execution to prevent unwanted results.