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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 09:00:02 2026 UTC