Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

fopen() cannot read .xml file from connection

$
0
0

I was able to read the .xml file, which is publicly available and accessible from the web browser, in a normal way until today as follows.

$file_handle = fopen($exchanges_file_url, 'r');

However, as of today, I realised that I encountered null values while reading.

when I print the output to the screen with

dd($file_handle);

stream resource @8 ▼ // app/Http/Controllers/InvoiceController.php:603  timed_out: false  blocked: true  eof: false  wrapper_data: array:2 [▼    0 => "HTTP/1.1 200 OK"    1 => "Connection: Close"  ]  wrapper_type: "http"  stream_type: "tcp_socket/ssl"  mode: "r"  unread_bytes: 189  seekable: false  uri: "http://www.tcmb.gov.tr/kurlar/today.xml"  options: []}

My Laravel project is running on my local computer. When I upload the same project to the web server, the .xml file is read without any problems.

Using artisan commands, cache, config, etc... I deleted everything with optimize:clear and one by one, but nothing changed.I turned the modem off and on, changed the ip address and still the result is the same.When I try to read with curl, I get the same result.I also saw that the 'allow_url_fopen' option is 'on' in my php.ini file.I added User-Agent and again the same result, nothing changed.

Can you help me.

I am waiting for a result regarding the answer to my question or an alternative method to be presented.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>