`mcrypt_create_iv`停转,但仅通过Apache [英] `mcrypt_create_iv` Stalls, But Only Through Apache

查看:91
本文介绍了`mcrypt_create_iv`停转,但仅通过Apache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本​​地PHP安装最近开始执行此操作,但是我不知道发生了什么更改,因此可能已经开始了.当我调用mycrypt_create_iv时,它会完全以100%的CPU使用率停滞,但是当Apache调用时,它只是 .当我从CLI调用它时,它几乎立即返回.我的测试文件如下:

My local installation of PHP started doing this recently, but I don't know what changed and could have started this. It completely stalls out with 100% CPU utilization when I call mycrypt_create_iv, but only when that's called by Apache. When I call it from the CLI, it returns almost instantly. My test file is as follows:

<?php echo mcrypt_create_iv(16, MCRYPT_DEV_URANDOM);

当然,值是我发现此问题时调用的函数. PHP 5.5或5.6都会发生此问题,因此我认为它不是特定的PHP版本.

The values are, of course, what the function was getting called with when I discovered this issue. This issue happens with either PHP 5.5 or 5.6, so I don't think it's the specific PHP version.

我正在运行Gentoo Linux,因此根本原因可能是构建问题,但是我已经重建了libmcrypt,PHP和Apache,但均无效.

I'm running Gentoo Linux, so it's possible that the root cause was a build issue, but I've rebuilt libmcrypt, PHP, and Apache to no effect.

推荐答案

经过一番实验,我明白了.

After some experimentation, I got it.

我没有在make.conf中设置APACHE2_MPMS,因此它默认为worker MPM.我将其设置为使用prefork,此问题已清除.

I did not have APACHE2_MPMS set in make.conf, so it defaulted to the worker MPM. I set it to use prefork and this problem cleared away.

我确实设置了threads USE标志,该标志与prefork和PHP冲突,因此我删除了该use标志.在我的个人资料中,这意味着大多数带有该标志的软件包仍然对其进行了设置,但禁用了phpmod_php.

I did have the threads USE flag set, which conflicted with prefork and PHP, so I removed that use flag. With my profile, that meant that most packages with that flag still had it set, but php and mod_php disabled.

这篇关于`mcrypt_create_iv`停转,但仅通过Apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆