PHP错误”;file_get_contents&;需要授权”;在Wordpress中


PHP Error "file_get_contents & Authorization Required" in Wordpress

我的一个wordpress插件出现了问题。当我激活它时,屏幕顶部会显示此消息。

Warning: file_get_contents(http://gruender-news24.de/wp-content/plugins/ultproteam_/includes/../css/font-awesome.css): failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in /mnt/web7/e3/69/5941469/htdocs/WordPress_08/wp-content/plugins/ultproteam_/includes/plugin-class.php on line 336

这个代码在336线上。

$pTsubject = file_get_contents( $this->mainPath . '/css/font-awesome.css');

我对php不是很熟悉,我自己也搞不懂。这似乎提供了一个解决方案,但我无法在我的特殊问题上"转换"它。

http://www.hashbangcode.com/blog/using-authentication-and-filegetcontents

非常感谢你的帮助!

file_get_contents()使用fopen()包装,因此它被限制通过php.ini 中的allow_url_fopen选项访问url

尝试使用CURL。

这里有很多很好的答案,看起来像是一个重复的问题。