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

  • Home
  • SEARCH
  • 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 811389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:02:17+00:00 2026-05-15T01:02:17+00:00

On a server I have the file some.php. I try to read the contents

  • 0

On a server I have the file some.php. I try to read the contents using file_get_content and fread. Both these don’t read my content.

If I try some other URL like yahoo.com, these functions are reading the contents. Why does this happen?

$my_conetn =  file_get_contents("http://example.com");
echo $my_conetn;

The above snippet is not working.

$handle = fopen($filename, "r");
$contents = fread($handle, 20);
echo $contents;
fclose($handle);

Also the above snippet is not working.

How to check my server? Is there any file read operation locked or not?

edit: I am not sure, but it is only my server file that can’t be read. I can read the other server links. So I contact my hosting provider, then I get back to you guys/gals.

  • 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. Editorial Team
    Editorial Team
    2026-05-15T01:02:17+00:00Added an answer on May 15, 2026 at 1:02 am

    When using file functions to access remote files (paths starting with http:// and similar protocols) it only works if the php.ini setting allow_url_fopen is enabled.
    Additionally, you have no influence on the request sent. Using CURL is suggested when dealing with remote files.

    If it’s a local file, ensure that you have access to the file – you can check that with is_readable($filename) – and that it’s within your open_basedir restriction if one is set (usually to your document root in shared hosting environments).

    Additionally, enable errors when debugging problems:

    ini_set('display_errors', 'on');
    error_reporting(E_ALL);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for some clarity on the SQL Server log file. I have a
I have some settings I need in a Javascript file -- servers to connect
I have a file on a Windows 2003 server which is locked by a
I have a db2 database file, but do not have a db2 server. I
I have DocumentRoot /var/www/test in my .htaccess file. This is causing the apache server
On the SVN server, there is a file called config.conf . I have a
In SQL Server I have a DATETIME column which includes a time element. Example:
A single Biztalk Server can have multiple Host processes. Is it possible to create
On a server I have to take care of, errors from a vhost do
My requirement is I have server J2EE web application and client J2EE web application.

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.