Note that there are some explanatory texts on larger screens.

plurals
  1. POcronjob calling a php function not responding
    text
    copied!<p>I have a Cronjob which calls a php script. The cronjob is executing because I have it set to send me an email when it does. The php script works properly when executed manually. I believe it may have something to do with the permissions, but I am not sure how to check if that's the case. I am using godaddy.</p> <p>Here is the php script:</p> <pre><code>$dayOfWeek = date('w'); if($dayOfWeek == 1) $xml = file_get_contents('http://xxxxx.com/mon.xml'); if($dayOfWeek == 2) $xml = file_get_contents('http://xxxxx.com/tues.xml'); if($dayOfWeek == 3) $xml = file_get_contents('http://xxxxx.com/wed.xml'); if($dayOfWeek == 4) $xml = file_get_contents('http://xxxxx.com/thurs.xml'); if($dayOfWeek == 5) $xml = file_get_contents('http://xxxxx.com/fri.xml'); if($dayOfWeek == 6) $xml = file_get_contents('http://xxxxx.com/sat.xml'); if($dayOfWeek == 7) $xml = file_get_contents('http://xxxxx.com/sun.xml'); file_put_contents('Bars.xml', $xml); mysql_connect("xxxx.hostedresource.com", "user", "userpw") or die(mysql_error()); mysql_select_db("dbname") or die(mysql_error()); mysql_query("UPDATE mytable SET isWorking='0' WHERE isWorking='1'") or die(mysql_error()); </code></pre> <p>I am receiving the following error message:</p> <pre><code> &lt;br /&gt; &lt;b&gt;Warning&lt;/b&gt;: file_get_contents(http://xxxxxx.com/fri.xml) [&lt;a href='function.file-get-contents'&gt;function.file-get-contents&lt;/a&gt;]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in &lt;b&gt;/home/content/77/8761477/html/refreshXML.php&lt;/b&gt; on line &lt;b&gt;8&lt;/b&gt;&lt;br /&gt; </code></pre> <p>Any suggestions?</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload