在服务器端完全运行PHP脚本 [英] Running a PHP script completely on server side

查看:216
本文介绍了在服务器端完全运行PHP脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,即腻子得到定期断开。所以,当我从终端运行PHP脚本,它总是被打断。该脚本应该运行几个小时,所以我没有任何运气吧。

I'm having a problem where putty gets regularly disconnected. So, when I run a PHP script from the terminal, it always gets interrupted. The script is supposed to run several hours, so I'm not having any luck with it.

我怎样才能完全在服务器端运行此?我在阅读有关cron作业,但我有一个困难时期,在这个时候了解。是否有任何其他与cron我需要的东西?

How can I completely run this from the server side? I'm reading about cron jobs, but I'm having a hard time understanding at this time. Is there any alternative to cron for what I need?

予有需要被执行,一个接一个,或者是每次两个几个脚本PHP文件。任何想法?

I have several script PHP files that need to be run, one by one, or perhaps two at a time. Any ideas?

推荐答案

您不必把它留在cron任务运行 - 你可以运行PHP脚本的屏幕里面

You don't need to leave it run in a cron job - you can just run the php script inside a screen.

只需输入;

screen php /path/to/myphpscript.php

一个屏幕会继续即使您从腻子断开运行。如果您需要检查起来就可以了,你可以使用;

A screen will continue running even after you disconnect from PuTTY. If you need to check up on it, you can use;

screen -r

要重新重视自己这一进程,并查看任何输出。

To re-attach yourself to this process, and view any output.

这篇关于在服务器端完全运行PHP脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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