简体   繁体   English

向php.ini添加功能

[英]adding a function to php.ini

I used the function htmlentities() in my php script, but the server says: "undefined function" 我在PHP脚本中使用了htmlentities()函数,但服务器显示:“未定义的函数”

After some searching, I understand that the php installation on my webhost does not include that function, and that I can add the function by changing the php.ini file, but I have spent many hours searching, and have not found any information on how to actually do this. 经过一番搜索,我了解到我的虚拟主机上的php安装不包含该功能,并且可以通过更改php.ini文件来添加该功能,但是我花了很多时间进行搜索,但未找到有关如何进行操作的任何信息。真正做到这一点。

Any suggestions? 有什么建议么?

If your webhost's PHP install doesn't have something so basic as htmlentities() , it's time to get a new webhost. 如果您的虚拟主机的PHP安装没有htmlentities()这样的基本功能,那么该是时候获取新的虚拟主机了。 If it's that bizarrely locked down, you're also not likely to be able to tweak php.ini ... 如果那是奇怪的锁定,那么您也不太可能调整php.ini ...

我在手册中没有看到任何说明该功能在您启用的可选模块中的内容-您只需要PHP 4或5。确定要调用正确的功能吗?

It's surprising that this would be unavailable, but have you tried the alternate htmlspecialchars? 令人惊讶的是,这将不可用,但是您是否尝试了备用htmlspecialchars? It will deal with the ones that are most important to deal with. 它将处理最重要的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM