iconv_strlen函数导致执行超时,在MAMP上运行 [英] iconv_strlen function causing execution timeout, running on MAMP

查看:224
本文介绍了iconv_strlen函数导致执行超时,在MAMP上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行MAMP时,是否有任何人遇到过iconv_strlen函数的问题?

Has anyone had issues with the iconv_strlen function while running MAMP?

推荐答案

但不会抛出任何异常。我正在一个Zend框架网站。通过跟踪调试器深入的胆量,我跟踪到使用iconv_strlen的问题。

I have been having a timeout issue with it, but not with any exceptions being thrown. I'm working on a Zend Framework site. By following the debugger deep into the guts, I tracked the problem down to the use of iconv_strlen. It's not being called on any strange string, it's a simple function being used to validate a hostname.

为了验证这个问题,我尝试了一个简单的iconv_strlen(test,这是一个简单的函数用来验证一个主机名。 'UTF-8');这导致错误出现 - 浏览器中无尽的旋转装载器,但没有错误日志消息,并且脚本超出最大执行时间。看来这是一个未被捕获的大版本的PHP。

To verify the issue, I tried a simple iconv_strlen("test", 'UTF-8'); This causes the error to come up - endless spinning loader in browser but no error log message, and the script goes beyond the max execution time. It seems that this is an uncaught big in this version of PHP.

我的同事发现这篇文章可能会解决这个问题。我在Mac OS X机器更新到最新的雪豹,这是10.6。这似乎是一个已知的错误,如果你建立自己的PHP或使用内置的苹果版本或使用端口有一个解决方法。

My colleague found this article which might address the issue. I'm on a Mac OS X machine updated to the latest Snow Leopard, which is 10.6. It seems that this is a known bug and there is a workaround if you build your own php or use the built in Apple version or use ports.

很长的故事,你可以深入到使用上述补丁重新编译自己的php

Long story short, you can delve into recompiling your own php with the above patch, but this kind of defeats the point of MAMP in the first place.

最快的解决方案是不要使用iconv_strlen()(或任何iconv_函数) - - 并且这不是一个选项,如果你使用Zend Framework - 或者还原MAMP使用php 5.2。

The quickest solution is simply either never use iconv_strlen() (or any of the iconv_ functions) - and this is not an option if you use Zend Framework - or else revert MAMP to use php 5.2.

直到MAMP开始包括php源文件,并提供一个方法,通过它可以轻松地重新编译绑定了所有必要的库的php,这将必然仍然是包。 MAMP工作得很好,直到你到达你需要重新编译PHP的点。当发生这种情况时,简单地使用端口就容易多了。

Until MAMP begins including php source files and providing a method by which to easily recompile the php bundled with all of the necessary libraries, this is will necessarily remain a limitation of the package. MAMP works great until you get to the point where you need to recompile php. When that happens, it's far easier to simply use ports.

这篇关于iconv_strlen函数导致执行超时,在MAMP上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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