Juszeil Conception

Juszeil Conception

  • 主 頁
  • 部 落 格
  • 相 簿
  • 關 於
  • 更 新 資 訊
  • 網站地圖

«2015 - 1»
日一二三四五六
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
TODAY

Hide Banner | LOGIN
2023-3-21 |

BLOG 部落格

Total found 1 articles on 2015-1-31.

銵 2015-1-31 15:22:22

Linux / UNIX Setup and Run PHP Script As A Cron Job


You need to setup execute permission on a php script. You need to use chmod command to change file access permissions. Use chmod command as follows:

chmod +x scriptname.php

Also make sure you add following line to top of php script (first line should be #!/usr/bin/php):

#!/usr/bin/php

If you are using FreeBSD, use:

#!/usr/local/bin/php

#!/usr/bin/php is called as a shebang (pound bang). It execute php script using the interpreter /usr/bin/php.

Save and close the file.

Setup and run php script as a cron job

Now add cron job by typing following command:
$ crontab -e
Output:

# run everday at 10:45
45 10 * * *     /path/to/myphpscript.php

Save and close the file.


Relate Post : PHP - APC module Web Cache PHP - 芷文銝脤剖偏嚗銝憭嚗孵摮 (拍 trim ) PHP湔詨賣貊蝔格寞 PHP - Resize and crop image from center PHP String Chopping Excerpt MyISAM InnoDB 雓閫 PHP - header:銝頛頧蝑蝑 PHP - 瑼X Email IP 澆臬血瘜 PHP - SQL Injection PHP - 憒雿霈 PHP Y(array) 頧 JavaScript 臭誑雿輻函拐辣(Object)澆 ( json_encode() 頧
Comments :
No Comments

Post your comment:


Post your comment by Guest :
Verify Code :


Back To Top

Find Me

Powered By 2013-2015 ©. Juszeil Conception version 2.0
Queries Executed : 0.0104 seconds