Solved : fopen and fread not working with url in php

Many times we normally face problems while reading a file using url
For e.g :
$url = ‘http://somesite.com/somefile.txt’;
$fp = fopen($url,”r”);

To allow the fopen to get the contents of the file through url, do the following settings in php.ini file :
allow_url_fopen = On
allow_url_include = On

By setting above 2 directives to ‘On’, fopen will be able to read the contents from url.

Incoming search terms:

You may like following Articles!

This entry was posted in PHP and tagged by Wordpress API. Bookmark the permalink.

About Wordpress API

API means Application Program interface. In Wordpress API we are giving all the information about wordpress API. We worked for many wordpress plugins and themes. We have expertise in PHP, Databases, Graphic Design, Ruby on Rails, Java, Wordpress, Drupal and many CMS. We always give you the best solutions about wordpress and other related topics in This Blog. We will give you always fresh tips and tricks and techniques about wordpress in this blog.

7 thoughts on “Solved : fopen and fread not working with url in php

  1. Pingback: uberVU - social comments

  2. Im happy I located this blog site, I couldnt find any info on this subject matter prior to. I also run a niche site and if you are ever interested in doing some visitor writing for me you should feel free to let me know, im always look for people to check out my webpage. Please stop by and leave a comment sometime!

  3. I don’t agree with everything in this summary, but you do make some very good points. Im very interested in this topic and I myself do alot of research as well. Either way it was a well thoughtout and nice read so I figured I would leave you a comment. Feel free to check out my website sometime and let me know what you think.

  4. This is a good write-up, I was wondering if I could use this posting on my website, I will link it back to your website though. If this is a problem please let me know and I will take it down right away.

  5. I dont know what to say. This is absolutely one of several far better blogs Ive read. Youre so insightful, have so much actual stuff to bring on the table. I wish that much more people read this and get what I got from it: chills. Excellent job and excellent web site. I cant wait to read additional, retain them comin!

  6. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely useful for me.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>