Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 173579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:22:06+00:00 2026-05-11T13:22:06+00:00

the php fopen fails to open a file for reading, if the file permission

  • 0

the php fopen fails to open a file for reading, if the file permission is 440. I don’t want to give 444 permission to the file, so that it can’t be accessed directly through a URL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:22:07+00:00Added an answer on May 11, 2026 at 1:22 pm

    You can do as tj111 suggests, block it with .htaccess.

    But even better idea is to put it outside of the www root.

    For example if your PHP files are in /home/user/public_html/, put your files with limited access e.g. in /home/user/includes giving them 644 (rw-r--r--). You can limit directory permissions to 711 (rwx--x--x), so no one but you can see what files are there. This doesn’t prevent you though, from reading or including these files using PHP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a PHP code that creates another PHP file with fopen and
Possible Duplicate: PHP create a file without fopen I want to create a file
I'm having problems using fopen in php. If I open the desired URL by
Using PHP, it's possible to read off the contents of a file using fopen
I'm trying to create a php page with fopen() this php file will house
I can't seem to open a Windows named pipe more than once from PHP:
Is there a way to create a file with PHP when fopen is disabled?
I have a HTML page that creates dynamically other HTML pages using PHP (fopen,fwrite,...).
I was trying out this tutorial for reading rss feeds with a php file
Whit the follow code: $file = fopen('php://input', 'r'); $temp = tmpfile(); $imageSize = stream_copy_to_stream($file,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.