Bug #69294 [Opn->Fbk]: function readfile return a 404 file

From: Date: Wed, 25 Mar 2015 03:11:11 +0000
Subject: Bug #69294 [Opn->Fbk]: function readfile return a 404 file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191584@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69294&edit=1 ID: 69294 Updated by: requinix@php.net Reported by: apple at ipple dot net Summary: function readfile return a 404 file -Status: Open +Status: Feedback Type: Bug Package: Filesystem function related Operating System: centos6 PHP Version: 5.4.39 Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Works for me. var_dump(readfile("http://example.com/filename.txt")); Warning: readfile(http://example.com/filename.txt): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in - on line 3 bool(false) Oh, and don't submit bug reports with code that uses error suppression. Previous Comments: ------------------------------------------------------------------------ [2015-03-25 02:39:43] apple at ipple dot net Description: ------------ when readfile a remote file does not exist, it return the 404 file. don't return false. PHP 5.4.14 (cli) CentOS Test script: --------------- if(!@readfile("http://example.com/filename.txt")){ dheader("location: http://www.test.com/file/somefile.txt"); } Expected result: ---------------- return false php 5.2 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69294&edit=1

« previous php.bugs (#191584) next »