PHP: Error trying to run a script via Cron job -


i have setup cron job via control panel. have uploaded script via ftp, set it's permission 777 (is safe so?) & gave path script in job. script makes use of dependent scripts able run job. confusing? here's it's like:

cron.php

<?php require("some_file1.php"); require("file1.php"); require("folder1/file1.php"); require("folder1/file2.php"); require("folder2/file1.php");  //this value received 1 of require files above after come calculations $get_content = 'this value received after calculations.';  mail('hi', 'email@mydomain.com', $get_content, 'error'); ?> 

i have opted receive confirmation of cron job email & here's error received:

mydomain.com/cron.php: line 1: syntax error near unexpected token `(' mydomain.com/cron.php: line 1: `<?php require("some_file1.php"); ' 

i tried talking support don't have idea of technical detail & technical guys not available. great if can me out here.

looking forward replies.

thank you.

i think, have different configuration files mod_php , command-line php. thing check - try add interpreter string top of php file:

for example:

 #!/usr/local/sbin/php 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -