Jump to content

[SOLVED] crontab problem


ted_chou12

Recommended Posts

Why is it when I am trying to let the crontab to run this file, this:

crawler.php: line 1: syntax error near unexpected token `('

crawler.php: line 1: `<?php $files = file("links/db.txt");'

shows up?

line 1 of that file looks like this:

<?php $files = file("links/db.txt");

thanks

Ted

Link to comment
https://forums.phpfreaks.com/topic/47090-solved-crontab-problem/
Share on other sites

when I tried:

<?php 
$files = file("links/db.txt");

The error becomes:

crawler.php: line 1: ?php: No such file or directory

crawler.php: line 2: syntax error near unexpected token `('

crawler.php: line 2: `$files = file("links/db.txt");'

 

The path that I entered to the crontab is something like:

/home/username/directories/crawler.php

well the first problem your gonna face is that if we don't know fully what you want how can we help.

 

yes it doesn't work we know but what are you trying to do, open the file to do what?

 

we need a sample code or something relating to a problem not just the small bit thats wrong.

I am trying to store html codes of all the pages in my site, so this script has to be run everyday, in order to update those pages.

If anyone can point out what the syntax for the first line might mean, I may try to solve by myself. But the problem is I dont understand what the "syntax error near unexpected token `('" means, so I am facing some problem, I already searched it in google, but the results arent very related to what i am looking for.

Ted

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.