Products
GG网络技术分享 2025-03-18 16:12 0
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;
}
图片转代码服务由CSDN问答提供
感谢您的意见,我们尽快改进~
功能建议我刚刚在本地安装了WordPress(XAMPP)并添加了一些插件并使用了tesseract主题。 当我尝试在本地网站上工作时,我得到一长串错误,但这些错误在使用互联网时消失。</ p>
错误:</ p>
< blockquote>
警告:fopen():php_network_getaddresses:getaddrinfo失败:没有这样的主机。 在第1255行的C:\\ xampp \\ htdocs \\ wordpress \\ wp-content \\ themes \\ TESSERACT \\ functions.php </ p>
警告:fopen( https://s3.amazonaws.com/tesseracttheme/banner/admin_message.csv ):无法打开流:php_network_getaddresses:getaddrinfo 失败:没有这样的主人知道。 在第1255行的C:\\ xampp \\ htdocs \\ wordpress \\ wp-content \\ themes \\ TESSERACT \\ functions.php </ p>
警告:feof()要求参数1为资源,布尔值在 第1256行的C:\\ xampp \\ htdocs \\ wordpress \\ wp-content \\ themes \\ TESSERACT \\ functions.php </ p>
警告:fgetcsv()要求参数1为资源,在C中给出布尔值 :\\ xampp \\ htdocs \\ wordpress \\ wp-content \\ themes \\ TESSERACT \\ functions.php第1257行</ p>
警告:feof()要求参数1为资源,布尔值在C中给出: 第1256行\\ xampp \\ htdocs \\ wordpress \\ wp-content \\ themes \\ TESSERACT \\ functions.php </ p>
</ blockquote>
这就是我在functions.php上的内容</ p >
function readCSV($ csvFile){$ file_handle = fopen($ csvFile,\'r\');
while(!feof($ file_handle)){
$ line_of_text [ ] = fgetcsv($ file_handle,1024);
}
fclose($ file_handle);
返回$ line_of_text;
}
</ code> </ pre>
</ div>
网友观点:
It happens because theme try to open files on remote server. That`s why you need an internet connection.
Demand feedback