php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76288 I cannot open .txt files with file_get_contents, but I can open other files.
Submitted: 2018-04-30 14:28 UTC Modified: 2018-04-30 14:33 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: im_not_gonna_tell_ya at yahoo dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 7.2.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: im_not_gonna_tell_ya at yahoo dot com
New email:
PHP Version: OS:

 

 [2018-04-30 14:28 UTC] im_not_gonna_tell_ya at yahoo dot com
Description:
------------
---
From manual page: http://www.php.net/features.commandline.io-streams
---


Test script:
---------------
#This works fine
$x = file_get_contents('example.html');

#This does NOT work
$x = file_get_contents('example.txt');

#Both files exist on the server and have exactly the same content and permissions






Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-30 14:32 UTC] spam2 at rhsoft dot net
for sure not - php don't care about extensions or file-types here

set error_repprting to E_ALL and look at your errors
pretty sure your test-script is not what you are running in reality
 [2018-04-30 14:33 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2018-04-30 14:33 UTC] requinix@php.net
I can't tell you what's wrong but I can tell you that this is not a bug in PHP. Keep looking.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 06:01:35 2024 UTC