RE: [PHP] HELP problems running PHP4 script in CRON
| From: | scott [gts] | Date: | Tue, 19 Jun 2001 19:37:56 +0000 |
| Subject: | RE: [PHP] HELP problems running PHP4 script in CRON | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54414@lists.php.net to get a copy of this message | ||
try using full paths to your files.
> -----Original Message-----
> From: Splashy [mailto:kevsutherland@hotmail.com]
> Sent: Tuesday, June 19, 2001 9:29 AM
> To: php-general@lists.php.net
> Subject: [PHP] HELP problems running PHP4 script in CRON
>
>
> Hi,
>
> Please find script below and hopefully tell me why when I run it over the
> web it works perfectly but when I run it using cron or in a telnet session
> it errors saying no such file or directory.
>
> THIS IS THE ERROR
> /*
> ./fetch_news.php: ?: No such file or directory
> ./fetch_news.php: syntax error near unexpected token
> `fetchnews($mysourcefile,$m
> youtputfile,$myflashvar)'
> */
>
> THIS IS THE SCRIPT
> <?
> #Requires 3 Params
> #$mysourcefile = path to content source html file
> #$myoutputfile = path to content output html file
> #$myflashvar = Flash variable you wish to assign the content to eg:mynews,
> mytechnology
>
> function fetchnews($mysourcefile,$myoutputfile,$myflashvar)
> {
> $mysource=fopen($mysourcefile,"r") or die ("Couldn't open the Source
> file");
> $myoutput=fopen($myoutputfile,"w") or die ("Couldn't open the Output
> file");;
> fwrite($myoutput,$myflashvar);
> while (!feof($mysource))
> {
> $myline=fgets($mysource, 1024);
> $stripquotes=eregi_replace("'","`",$myline);
>
> $stripcolors=eregi_replace("COLOR=\"#.*\"","",$myline);
> if (eregi('^<a.*<\/a><br>',$stripcolors))
>
> {
> $newanchor=eregi_replace("<br>","",$stripcolors);
> fwrite($myoutput,"$newanchor<br>");
> }
> }
> fclose($myoutput);
> fclose($mysource);
> }
> ?>
> <?
> fetchnews("¦íCdîÉ
> -yÌÖë�“òhttp://www.moreover.com/cgi-local/page?c=Graphics%20industry%20ne
> ws&o=html","graphicsnews.php","mynews=");
> ?>
>
> All help and advise is as always gratefully received!
> Splashy.
>
>