是否可以在没有客户端请求的情况下在服务器上定期运行PHP脚本? [英] Can a PHP script be run regularly on a server without requests from a client?
问题描述
我将编写一个脚本来将文本文档解析到MySQL数据库中.我将使用单独的实用程序将PDF转换为文本.这些PDF将通过电子邮件附件提交.
I'll be writing a script to parse text documents into a MySQL database. I'll be converting PDF's to text with a separate utility. These PDF's will be submitted via e-mail attachments.
我正在寻找是否可以用PHP做到这一点,因为这是我最熟悉的服务器语言.第二个选择是Perl,但是我会接受您的建议.
I'm looking to see if I can do this with PHP since that's the server language I'm most familiar with. Second choice would be Perl, but I'll take your recommendations.
因此,该语言必须能够:
So the language needs to be able to:
- 在电子邮件帐户中检查带有附件的电子邮件(每隔几分钟左右).
- 保存附件.
- 使用正则表达式解析文件(查找联系信息).
- 并将结果放置在MySQL数据库中
由于它将由GoDaddy或类似服务器托管,因此我将无法完全访问该服务器.
I won't have full access to the server since it'll be hosted by GoDaddy or similar.
我熟悉PHP,但是我想不起来如何系统地检查邮箱.如果PHP无法做到这一点,那么是否存在可以在不执行浏览器请求的情况下在执行任务的服务器上持续运行的语言?
I'm familiar with PHP but I can't think of how I'd have it systematically check a mailbox. If PHP can't do it, are there languages that run constantly on a server performing tasks without requests from a browser?
谢谢.
推荐答案
您可以使用通过定时作业.
这篇关于是否可以在没有客户端请求的情况下在服务器上定期运行PHP脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!