1

所以我在我客户的网站上工作,为了将 twitter 帖子集成到网站中,我需要在 PHP.ini 中包含以下行:

allow_url_fopen = On;

所以现在我的 PHP.ini 看起来像这样:

; Rename this file to php.ini and uncomment or add directives.
; For a complete list of valid directives, visit:
;  http://us2.php.net/manual/en/ini.php

[PHP]
; We highly recommend that you leave this options enabled
cgi.fix_pathinfo=1

; Increase maximum post size
;post_max_size = 20M

; Increase execution time
;max_execution_time = 300

; pull in EGPCS [Environment, GET, POST, Cookie, Server] variables as globals
;register_globals = true

; For performance reasons, (mt) does not load all of the modules that are available
; into PHP. You may uncomment any one of the following "extension" lines to enable
; the desired module

; Salblotron XSLT
;extension=xslt.so

; save in local tmp
session.save_path=/home/65994/data/tmp

allow_url_fopen = On;

upload_max_filesize = 20M

出于某种原因,它可以工作......但只有大约 15 分钟左右才会中断并出现错误。

不过,如果我将添加到 php.ini 的行移到周围...并重新保存,它会再次起作用...

奇怪的...

有谁知道为什么或如何解决这个问题?

4

1 回答 1

0

MT 现在默认禁用不安全的 php 功能,因此即使您重新启用了“攻击性”选项,您的问题很可能是由于导致超时的原因。尝试设置

default_socket_timeout

更长的选项http://php.net/manual/en/filesystem.configuration.php

顺便说一句,如果您使用 Twitter OAuth 切换到 cURL 而不是直接打开 url,您可能会省去一些麻烦。

于 2012-07-06T17:29:26.427 回答