cron作业和PHP(Zend Framework)入门 [英] Getting started with cron jobs and PHP (Zend Framework)

查看:95
本文介绍了cron作业和PHP(Zend Framework)入门的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Cron工作这个主题完全陌生,所以我不知道从哪里开始学习它们。

I am totally new to the subject of cron jobs so I have no idea where to start learning about them; when, why, or how to use them with my Zend Framework application, or PHP in general.

任何人都可以举例说明这个过程,或者推荐一些好的资源吗?

Can anyone explain the process, with an example, or recommend some good resources to get started?

推荐答案

Cron作业是一种在Linux操作系统中自动执行任务的机制。与Zend Framework无关。该框架可以帮助您使用php开发高级cron任务。但是随后您将不得不在shell中设置您的cron作业。

Cron jobs is a mechanism to automate tasks in Linux operating system. And has pretty little to do witn Zend Framework. The framework can help you develop an advanced cron task in php though. But then you will have to set up your cron job in the shell.

在Google搜索如何设置cron作业顶部显示了此链接:

Googling for "how to set up cron job" revealed this link at the top:

http://www.adminschoice.com/ docs / crontab.htm

我确定本文会为您提供帮助。

I'm sure this article will help you.

PS

作为执行命令,您应该输入以下内容:

As a command to execute you should put something like:

/ usr / local / bin / php -f< path_to_your_php_script>

其中第一个路径是php cli可执行文件的完整路径,可能有所不同在您的机器上。您可以通过发出以下命令来确保:

where the first path is the full path to your php cli executable, which may differ on your machine. You can make sure by issuing this command:

哪个php

有cron职位的祝你好运;)

Good luck with cron jobs ;)

这篇关于cron作业和PHP(Zend Framework)入门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆