radioactive radioactive - 17 days ago 6
PHP Question

Wordpress theme not working on localhost

I just installed WordPress locally (XAMPP) and added some plugins and using the tesseract theme. When I try to work on the website locally, I get a long list of errors but these errors disappear when am using the internet.

The errors:

Warning: fopen(): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\xampp\htdocs\wordpress\wp-content\themes\TESSERACT\functions.php on line 1255

Warning: fopen(https://s3.amazonaws.com/tesseracttheme/banner/admin_message.csv): failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\xampp\htdocs\wordpress\wp-content\themes\TESSERACT\functions.php on line 1255

Warning: feof() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wordpress\wp-content\themes\TESSERACT\functions.php on line 1256

Warning: fgetcsv() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wordpress\wp-content\themes\TESSERACT\functions.php on line 1257

Warning: feof() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\wordpress\wp-content\themes\TESSERACT\functions.php on line 1256

This is what I have on functions.php

function readCSV($csvFile){
$file_handle = fopen($csvFile, 'r');
while (!feof($file_handle) ) {
$line_of_text[] = fgetcsv($file_handle, 1024);
}
fclose($file_handle);
return $line_of_text;
}


Please I need your help

Answer

It happens because theme try to open files on remote server. That`s why you need an internet connection.