PHPackages                             taskphp2/taskphp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. taskphp2/taskphp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

taskphp2/taskphp
================

taskphp for PHP 5.6

3.0.0(7y ago)02.3kMITPHPPHP &gt;=5.6.0

Since Apr 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/YangHuiFor/taskPHP)[ Packagist](https://packagist.org/packages/taskphp2/taskphp)[ Docs](https://github.com/qq8044023/taskPHP)[ RSS](/packages/taskphp2-taskphp/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

taskPHP 3.0 —— 你值得信赖的PHP定时计划任务框架
================================

[](#taskphp-30--你值得信赖的php定时计划任务框架)

历史版本
----

[](#历史版本)

\--&gt;[taskPHP1.x](https://gitee.com/cqcqphper/taskPHP/tree/taskPHP/1.0)
\--&gt;[taskPHP2.x](https://gitee.com/cqcqphper/taskPHP/tree/taskPHP/2.1)

> 所有分支 [查看所有分支](https://gitee.com/cqcqphper/taskPHP/branches)

taskPHP
-------

[](#taskphp)

taskPHP基于php开发的定时计划任务框架,多进程实现任务的分配和运行,多种进程间通信驱动支持,支持多线程模式需要安装pthreads扩展(可选),支持linux和windows。有较好的伸缩性、扩展性、健壮稳定性而被多家公司使用，同时也希望开源爱好者一起贡献。

项目地址
----

[](#项目地址)

github地址:
gitee地址:
这两个地址都会同步更新。

在线交流QQ群
-------

[](#在线交流qq群)

如感兴趣请加QQ群 一起探讨、完善。越多人支持,就越有动力去更新,喜欢记得右上角star哈。
[![taskPHP框架交流群]( "taskPHP框架交流群")taskPHP ①群:375841535（空）](//shang.qq.com/wpa/qunwpa?idkey=2a8520f5c1518df3a796e71d8c993b2f00856a035d59ca46285c4e325116ba4d)

框架说明

1. 任务多进程运行模式。
2. 任务多线程模式,需要安装pthreads扩展(可选)。
3. 多种进程通信方式堵塞式消息队列。
4. 任务派发及具体任务执行不在同个进程\[distribute\]和\[worker\],windows和linux下启用入口文件\[start.php\],windows下可运行\[windows\_start.cmd\]快速启动。
5. 执行时间语法跟crontab类似,且支持秒设置。

```
   * * * * * * *    //格式 :秒 分 时 天 月 年 周
  10 * * * * * *    //表示每一分钟的第10秒运行
 /10 * * * * * *	//表示每10秒运行
 /1 * 15,16 * * * * //表示 每天的15点,16点的每一秒运行
```

6. 添加任务简单,只需编写任务类,实现任务入口run方法,详情参考examples目录内的测试任务。

环境要求
----

[](#环境要求)

1. php版本&gt;= 5.5
2. 开启socket扩展
3. 开启pdo扩展
4. 开启shmop扩展

注意事项
----

[](#注意事项)

1. 由于任务存在派发时间，所以任务运行的时间可能会有1-2秒的误差。
2. 编写任务有问题或调用exit将导致后台脚本停止,需要通过远控管理器重启进程。
3. 多线程模式运行一段时间后报错,pthreads has detected that the taskphp\\Pthread could not be started, the system lacks the necessary resources or the system-imposed limit would be exceeded in xxx
4. 后台任务数量多或者任务运行时间很密集导致数据库链接过多没有释放,需要再任务结尾处执行数据库链接对象的close方法来关闭链接。
5. 在windows下代码存放路径不能有空格，否则会导致进程启动不起来。php的环境变量也最好也不要有空格，如果有空格可在框架配置中定义数组项php\_path='php'。

文档列表
----

[](#文档列表)

\--&gt;[数据库类使用教程](./src/docs/db.md)
\--&gt;[windows下安装php多线程扩展pthreads教程](./src/docs/thread_windows.md)
\--&gt;[工具类Utils使用说明](./src/docs/utils.md)
\--&gt;[thinkphp5.0框架的集成教程](./src/docs/thinkphp5.0.md)

使用说明
----

[](#使用说明)

### composer安装taskphp框架:

[](#composer安装taskphp框架)

```
composer require taskphp/taskphp dev-master
```

命令操作
----

[](#命令操作)

```
start.php  start [all|任务名]  启动 可不带参数默认all
start.php  start &   挂载后台运行,liunx操作
start.php  close all 结束框架  必带参数all
```

### 启动程序

[](#启动程序)

```
[root@FX-DEBUG taskphps]# php ./start.php start
------------------------- taskPHP ------------------------------
taskPHP version:3.0      PHP version:5.5.38
license1:https://github.com/qq8044023/taskPHP
license2:https://gitee.com/cqcqphper/taskPHP
startTime:2018-04-04 10:00:50
------------------------- taskPHP Manage  ----------------------
http://ServerIp:8082
http://127.0.0.1:8082
------------------------- taskPHP PROCESS ----------------------
listen                      processes                     status
distribute                    1                          [success]
demo1                         1                          [success]
demo2                         1                          [success]
----------------------------------------------------------------
Press Ctrl-C to quit. Start success.
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2624d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86aee8496a99c26078c33c84c1606435e6559170abb6725023f0b2b5bb59a311?d=identicon)[YangHuiFor](/maintainers/YangHuiFor)

---

Top Contributors

[![8044023](https://avatars.githubusercontent.com/u/20453902?v=4)](https://github.com/8044023 "8044023 (119 commits)")[![yimuczhou](https://avatars.githubusercontent.com/u/4995476?v=4)](https://github.com/yimuczhou "yimuczhou (7 commits)")[![qq8044023](https://avatars.githubusercontent.com/u/25117305?v=4)](https://github.com/qq8044023 "qq8044023 (3 commits)")[![zouxia](https://avatars.githubusercontent.com/u/27995437?v=4)](https://github.com/zouxia "zouxia (1 commits)")

---

Tags

tasktimePHPtaskphpphptask

### Embed Badge

![Health badge](/badges/taskphp2-taskphp/health.svg)

```
[![Health](https://phpackages.com/badges/taskphp2-taskphp/health.svg)](https://phpackages.com/packages/taskphp2-taskphp)
```

###  Alternatives

[phing/phing

PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

1.2k22.5M912](/packages/phing-phing)[laravel-admin-ext/scheduling

Task scheduling extension for laravel-admin

95254.5k6](/packages/laravel-admin-ext-scheduling)[arara/process

Provides a better API to work with processes on Unix-like systems

16862.8k2](/packages/arara-process)[rewieer/taskschedulerbundle

Task Scheduler with CRON for Symfony

63251.6k](/packages/rewieer-taskschedulerbundle)[ttree/scheduler

Simple task scheduler for Neos Flow Framework

21110.9k1](/packages/ttree-scheduler)[trentrichardson/cakephp-scheduler

Makes scheduling tasks in CakePHP much simpler.

3241.7k](/packages/trentrichardson-cakephp-scheduler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
