Hi,
I've setup a cron jobwhich is intended to execute a php script.
I get the following message emailed to me when the job is run:
line 1: ?: No such file or directory
line 2: syntax error near unexpected token `"localhost",'
line 2: `$dbh=mysql_connect ("localhost", "uname", "pword") or die ('I cannot connect to the database because: ' . mysql_error());'
The script is supposed to insert some data into a table.
Any ideas?
Setting up a cron job in phpMyAdmin
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Yes. You probably have only entered the path of the script into the crontab program. It needs two parts:
So, a sample crontab command would be:
Code: Select all
/path/to/php /path/to/scriptCode: Select all
/usr/bin/php /home/scott/cron/myscript.phpSet Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London