Moved the site to another server. Add file statistic.php to the Сron to perform. Only this Cron that does not like something. Write errors:
/home/site/www/statistic.php: line 1: ?php: No such file or directory
/home/site/www/statistic.php: line 2: syntax error near unexpected token `"bd.php"'
/home/site/www/statistic.php: line 2: `include ("bd.php");
There is my code
<?php
include ("bd.php");
$result = mysql_query("SELECT MAX(id) FROM statistic_dep",$db);
$myrow1 = mysql_fetch_array($result);
$last_id=$myrow1[0];
...
Make sure, that you execute the script as php script and not as bash script.
Your crontab should look like this:
* * * * * /usr/bin/php -f /path/to/file.php
Another way to execute the script as php is to add a shebang in the first line:
#!/usr/bin/php
<?php ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With