cronジョブの実行に問題があります。
これが私のコードです:
<?php
$doc = new DOMDocument();
$doc->load( 'http://www.all-news.in/feed' );
$items = $doc->getElementsByTagName( "item" );
mysql_connect('host','username','pass');
mysql_select_db('dbname');
$i=0;
foreach( $items as $itemname )
{
// Here Business logic for Inserting the data
}
echo $i.' Imported';
?>
このファイルをブラウザで実行すると正常に動作しますが、cronを実行すると、次のエラーが発生します。
<br />
<b>Warning</b>: DOMDocument::load(http://www.all-news.in/feed) [<a href='domdocument.load'>domdocument.load</a>]: failed to open stream: Connection timed out in <b>/home/content/98/7509598/html/amz/social-bookmark.in/cron_jobs/all_news.php</b> on line <b>4</b><br />
<br />
<b>Warning</b>: DOMDocument::load() [<a href='domdocument.load'>domdocument.load</a>]: I/O warning : failed to load external entity "http://www.all-news.in/feed" in <b>/home/content/98/7509598/html/amz/social-bookmark.in/cron_jobs/all_news.php</b> on line <b>4</b><br />
0 Imported