内容へ移動
fl8 Wiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
Dokuwiki.fl8.jp
»
11_php
»
14 file_get_contentsのタイムアウト
トレース:
•
34 OpenNebula Ceph template
•
01 JuJu Maas Openstack
11_php:14_file_get_contents_timeout
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== 14 file_get_contentsのタイムアウト ====== file_get_contentsがタイムアウトしてしまってデータが取得できない場合がある。 <color #ed1c24>※php.iniとストリームコンテキスト両方やった方が良さそう。</color> ===== php.ini ===== php.iniでdefault_socket_timeoutの値を伸ばしてあげると良い。 default_socket_timeout = 60 ===== php.iniを使わない場合 ===== ストリームコンテキストで書いてあげる <code> $ctx = stream_context_create(array( 'http' => array( 'timeout' => 120 ) ) ); file_get_contents("http://example.com/", 0, $ctx); </code> {{tag>php}}
11_php/14_file_get_contents_timeout.txt
· 最終更新: 2020/02/12 10:03 by
matsui
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ