Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
fopen存在しないxmlファイルにアクセスすると、
fopen
ストリームを開くことができませんでした: HTTP 要求が失敗しました!
しかし、30秒かかります。ファイルが見つからなかった直後に、または短時間でこのエラーを返す方法。
また、ファイルが見つからない場合、Apache が多くのポートをスキャンするのはなぜですか?
これが方法だと思います. fopen自体を使用して、存在するかどうかを確認する必要があります.
function fileExists($path){ return (@fopen($path,"r")==true); } if(fileExists('http://example.com/test/file.xml')) { echo "exists"; } else { echo "not_exist"; }