dreamhost的主机默认不支持smartrss插件,查看了国外一些解决方案,找到了以下不错的办法,特分享给大家。

I solved this error with change file() and implode() function with curl function from wp_smartrss.php.
Look at line 29 at original source code(wp_smartrss.php), you can find :

  1. $data = implode(“”, file($filename));

Replace with

  1. if(ini_get(allow_url_fopen)){

  2. $data = implode(“”, file($filename));

  3. }elseif(function_exists(curl_init)){

  4. ?$ch = curl_init();

  5. $timeout = 5; // set to zero for no timeout

  6. ?curl_setopt ($ch, CURLOPT_URL, $filename );

  7. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

  8. ?curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

  9. $data = curl_exec($ch);

  10. ?curl_close($ch);

  11. ?}else{

  12. ?echo “<br />Ooops. Looks like your server supports neither <a href=\”http://us3.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen\”>url_fopen</a> nor

  13. <a href=\”http://us2.php.net/manual/en/ref.curl.php\”>cURL</a>. Style information disabled.<br /><br />”;

  14. ?return;

  15. ?}

Remember ! If you have a problem with your website with error warning :

file() [function.file]: URL file-access is disabled in the server configuration in bla..bla
or implode() [function.implode]: Bad arguments. in bla..bla

Just replace that function with curl