How to Run a Cron Job?

I uploaded, via Core FTP, a fresh untouched copy of the nws-alerts-config.php and still get the blank page. Totally and completely frustrated. I feel like it’s $70 just wasted.

What did the host support say/do?

The email I got from the hosting company says to use /usr/local/bin/php.

I did that and the cron job never worked. The main issue right now is the blank page.

Since you are addressing a complete newbie here I ask what to do to fix these things. I do very much appreciate your help!

The 'blank" page is not realy blank, it only does not display human readable text. When you do a “view source”, (in via Chrome right-click) you see that there are 140 lines of html and that the index.php is processed until the first script in the <body part.

visibility:visible;
}

</style>
<!-- end of flyout-menu.php CSS definition -->
<!-- World-ML template from http://saratoga-weather.org/wxtemplates/ -->
<!-- end of top -->
</head>
<body>

So can you post the index.php. Rename it first as index.php.txt
I just want to know what is called first in the body part.

Can you also post the nws-alerts-config.php as nws-alerts-config.php.txt.

Someone can then test it to see what the offending lines are causing this 500 error.

Wim

I have attached the files. Let me know if you need more and thanks!


index.php_20150914130140.txt (4.78 KB)

nws-alerts-config.php_20150914130216.txt (5.78 KB)

Change line 39 in nws-alerts-config.php from

$ourTZ         = 'America/Chicago    // Time Zone     http://www.php.net/manual/en/timezones.america.php

to

$ourTZ         = 'America/Chicago';   // Time Zone     http://www.php.net/manual/en/timezones.america.php

You forgot a quote/apostrophe and semicolon ';

Wim

The two settings files have no sce=view support as they contain confidential information. They will not display anything when called directly. I checked them, they contain correct data. As do most other scripts. The 500 error was a typo in the nws config file.
Wim

Excellent! That got the site back up? Why do I still have the cron message at the top of the screen I changed that the “true”?

It’s a trick question:

$noCron = true;

true = you DON’T have cron
false = you DO have cron

Could you please be more specific, what “that” did you " changed that the “true”?"

$noCron        = true;                     // true=not using cron, update data when cache file expires   false=use cron to update data

So if you set that to false, the script will not update and expect you run a cronjob to do the updates.

You can test the by setting it to false and the warnings will not change until you run a cronjob (with mu=1).

Wim

The pics should tell the story. I an set to true, but I still get the warning at the top of the webpage?


I don’t understand why you think the warning/suggestion to use cron should not be there. It is telling you that if you have more than 4 alerts selected (you have five) it would be a good idea to use a cron job but by setting $noCron = true; you are telling the script that you are not using a cron - so it shows the suggestion.

Niko, that’s also been the confusion. What counts as 5?

And I have tried to run a cron job, but the alert was still there?

That alert goes only away if you set nocron to false.

And it does not matter if you really run a job. If you tell you are using one, by setting nocron to false, the message will go away.

Wim

Well that fixed that though I’m not sure why lol. The site now is at least stable. I might want to add more alerts as I become more comfortable with it but I’m not touching it now. Thanks very much to all those who helped!

From the config you posted;

$myZC = array(
  "North Texas|TXZ104|TXZ120|TXZ105",
//  "Santa Cruz Mtns|CAZ512|CAC081|CAC085|CAC087",
  "Santa Cruz|CAZ529|CAC087",
//  "Monterey|CAZ530|CAC053",
//  "South/East Bay|CAZ508|CAC081",
//  "San Mateo Coast|CAZ509|CAC081",
//  "San Francisco|CAZ006|CAC075"
);

do you really want “Santa Cruz|CAZ529|CAC087”, ?

I took it out. I think. I only have the North Texas left.

There you go, an apostrophe/semicolon and a true/false was all the problem, keep trying and you’ll get there, don’t forget to have a backup copy of all your files in a safe folder just in case. In Notepad++ anything that is in green writing it’s not part of the code, blue and black is.