douxian1923
douxian1923
2016-11-22 20:03

Wordpress主题不在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;
}
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dounuo9921 dounuo9921 5年前

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

    点赞 评论 复制链接分享