php md5 哈希函数返回 500 内部错误
我正在尝试为字符串创建 md5 哈希值,但问题是每当我使用 md5 函数并运行该文件时,它都会返回 500 内部错误。
我使用的代码是
$php_hash_string = md5("test_hash");
当我注释掉文件时,不会产生错误,并且打印出其余的输出,但是当我使用 md5 函数时,它会生成 500 内部服务器错误。
谁能帮我解决这个问题吗?
服务器信息:CentOS 5.6 上的 LAMP
I am trying to create a md5 hash for a string but the problem is that whenever I use md5 function and run the file, it returns a 500 internal error.
the code i am using is
$php_hash_string = md5("test_hash");
When I comment out the file the error is not produced and the rest of the output is printed out but when i use the md5 function it generates 500 internal server error.
Can anyone please help me solve this problem?
Server info: LAMP on CentOS 5.6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
确保你执行了 yum install php-mcrypt 并查看是否有影响
make sure that you do yum install php-mcrypt and see if that makes a difference
我不知道你是否想用这种方式,但至少尝试一下。
这可能只是愚蠢的尝试,但大多数情况下只有愚蠢的事情才会产生问题。
并将其放在文件顶部:
I don't know if you want to use this way, but at least try it.
It's probably just stupid try, but mostly only stupid things make problems.
And put in top of the file this:
所以这不是您正在使用的代码,只是其中的一部分。
第一步是确认确实是 md5() 调用导致了问题。对于仅包含该语句的脚本,您是否仍然遇到问题?
您是否已验证您的安装是否已正确配置为报告/记录 PHP 错误?并且在执行 md5 函数时不记录错误?网络服务器没有记录任何与此相关的内容?例如尝试:(
这应该会产生致命的解析错误)
So that's not the code you are using, only a part of it.
The first step is to confirm that it really is the md5() call which is causing the problem. Do you still get problems with a script containing only that one statement?
Have you verified that your installation is correctly configured to report/log PHP errors? And that it is not logging errors when executing the md5 function? And there is nothing related to this logged by the webserver? e.g. try:
(this should produce a fatal parsing error)