Reputation: 21012
I have been using this code on a webpage for about 2 years and all of the sudden it started giving me an error. Is there any noticeable reason why?These are lines 116 through 120 that are referenced in the error
$file = fopen("http:/xxxxxx/climo/reports/".$fileName, "r");
$content = fgetcsv($file, 1000, ",");
$id = 1;
while ($content = fgetcsv($file, 1000, ",") != FALSE) {
error
.gov/climo/reports/today_raw_hail.csv) [function.fopen]: failed to open stream: no suitable wrapper could be found in /homepages/27/xxxx/htdocs/xxxxx/weather/php/mainEngine.php on line 116
Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /homepages/27/xxxxx/htdocs/xxxx/weather/php/mainEngine.php on line 117
Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /homepages/27/xxxx/htdocs/xxxx/weather/php/mainEngine.php on line 120
Upvotes: 0
Views: 364
Reputation: 99921
Apparently your hosting provider dropped support for http://
urls (as you can see in the errors).
Try reading the csv with curl instead.
Upvotes: 0
Reputation: 24645
Your host probably updated the 'allow_url_fopen' directive in the php.ini
http://php.net/manual/en/filesystem.configuration.php
Upvotes: 2