file-get-contents Questions

9

Calling file_get_contents() with https:// urls give me the following error: warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? ...
Schiedam asked 5/9, 2013 at 18:36

17

Solved

I am having problems calling a URL from PHP code. I need to call a service using a query string from my PHP code. If I type the URL into a browser, it works ok, but if I use file-get-contents() to ...
Varuna asked 30/3, 2009 at 14:31

4

Solved

I need to get the MIME type of an image, but I only have the body of the image which I've got with file_get_contents. Is there a possibility to get the MIME type?
Perusse asked 11/8, 2014 at 6:35

4

I am doing a simple app that reads json data from 15 different URLs. I have a special need that I need to do this serverly. I am using file_get_contents($url). Since I am using file_get_contents($...
Felicefelicia asked 16/2, 2012 at 9:40

6

I'm having some weird problems with file_get_contents after moving my site to a new domain. I had to set up a new domain and IP address (using Plesk) to get a new ssl certificate working. Now my fi...
Hulen asked 5/3, 2012 at 21:18

7

Solved

how can I display an image retrieved using file_get_contents in php? Do i need to modify the headers and just echo it or something? Thanks!
Encroach asked 26/11, 2010 at 15:48

4

Solved

I'm just using a file_get_contents() to get the latest tweets from a user like this: $tweet = json_decode(file_get_contents('http://api.twitter.com/1/statuses/user_timeline/User.json')); This wo...
Purslane asked 13/12, 2011 at 0:14

5

Solved

I am using the following API for getting the country code using IP http://api.hostip.info/country.php?ip=' . $IP Example: on Localhost $IP = '202.71.158.30'; //pass the ip as a parameter for ...
Glycoside asked 5/4, 2013 at 13:30

7

I have this piece of code below which works fine on my remote hosted server, but isnt for some reason working on my local linux machine. Ive tried using file_get_contents as well to get the restful...
Gershwin asked 30/6, 2011 at 2:56

1

I have a simple PHP script, which sends a GET request with some parameters to an external API, and receive some json data in response. I used file_get_contents for this, and it worked for the last ...
Didymium asked 25/9, 2020 at 7:39

8

Solved

I'm using Ubuntu 14.04 on my machine. I installed composer and then laravel in the document root i.e. /var/www I also gave -R 777 persmission to folder laravel present in directory /var/www ...
Sudorific asked 21/4, 2016 at 6:51

4

Solved

How do these two pieces of code differ when accessing a REST API? $result = file_get_contents('http://api.bitly.com/v3/shorten?login=user&apiKey=key&longUrl=url'); and $ch = curl_init('...
Soyuz asked 16/6, 2012 at 15:58

3

Solved

For 2 days I'm having trouble with my PHP script on my server. I've changed nothing and suddenly it didn't work anymore. Here is the code: $query = http_build_query($data); $options = array( 'http...
Dulce asked 22/11, 2013 at 16:19

10

I'm using PHP to send an email with an attachment. The attachment could be any of several different file types (pdf, txt, doc, swf, etc). First, the script gets the file using "file_get_contents"....
Vociferation asked 5/8, 2009 at 11:52

12

Solved

How can I replace a particular line of text in file using php? I don't know the line number. I want to replace a line containing a particular word.

21

Solved

I’ve been trying to access this particular REST service from a PHP page I’ve created on our server. I narrowed the problem down to these two lines. So my PHP page looks like this: <?php $respon...
Fitful asked 1/10, 2014 at 19:4

6

I'm trying to download an image from a server using a PHP script on my website on xampp server. The image is being downloaded using the function file_get_contents. The php code for downloading o...
Vociferate asked 19/11, 2013 at 6:6

4

I am trying to get content of a file with PHP. Then adding it inside a new file. I am using file_get_contents() but it shows the error: PHP Warning: file_get_contents(./home-starter.php): failed to...
Thermel asked 5/9, 2020 at 10:23

17

Solved

I wrote a PHP code like this $site="http://www.google.com"; $content = file_get_content($site); echo $content; But when I remove "http://" from $site I get the following warning: Warnin...
Latterll asked 7/11, 2008 at 15:10

3

I've searched for issues with this error but I'm baffled on what may have happened between a number of my own servers that have started to display this error: Warning: file_get_contents(): SSL oper...
Unchaste asked 30/9, 2021 at 18:26

1

I have a simple script, that searches inside every file of every subfolder for a given string. It worked just fine, until I believe my PHP got updated (I'm not pretty sure if it was because of that...
Osteoporosis asked 23/6, 2020 at 19:28

7

Solved

I'm reading a file in PHP from Alfresco and then outputting it to the browser. The only problem is the mime type or the extension of the file. This is the code I'm using: <?php ob_start(); requi...
Chiliad asked 12/1, 2011 at 17:8

6

Why does file_get_contents not work for me? In the test file code below, it seems that everyone's examples that I've searched for all have this function listed, but it never gets executed. Is this ...
Corycorybant asked 17/7, 2011 at 14:28

8

Solved

I use following PHP function: file_get_contents('http://example.com'); Whenever I do this on a certain server, the result is empty. When I do it anywhere else, the result is whatever the page's c...
Stets asked 15/8, 2010 at 17:23

1

From a comment to this answer I read that "stream_get_contents is low-level" comparing to file_get_contents. However according to Manual, stream_get_contents is Identical to file_get_contents(),...
Dupont asked 19/12, 2013 at 5:44

© 2022 - 2024 — McMap. All rights reserved.