I'm trying to do a cronjob via terminal to run a php file every minute.
I added this line in my crontab list ...
* * * * * /usr/bin/php /Applications/XAMPP/xamppfiles/htdocs/stc/testcron.php
but the file does not execute, I wonder if my way is wrong ? or I didn't get the idea of it clearly ..
update :
I'm expecting this file to add a new record in my database...
when I use the line in the above , it didn't work
but when I enter it in this way
* * * * * /usr/bin/curl —silent—compressed http://localhost/stc/testcron.php
it worked !! I don't Know if this way is correct , and what the problem of the first one.
testcron.php content
<?php
include('config/con_db.php');
$conn = db_connect();
$conn->query("INSERT INTO `locations`(`location_name`, `location_lat`, `location_long`) VALUES ('Dammam',4.4,5.5);");
?>