PHPackages                             jbc/php-cron - 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. jbc/php-cron

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

jbc/php-cron
============

Native PHP cron scheduler

v1.0.0(3mo ago)10MITPHPPHP &gt;=8.1

Since Apr 17Pushed 3mo agoCompare

[ Source](https://github.com/joaomboni/Php-Cron)[ Packagist](https://packagist.org/packages/jbc/php-cron)[ RSS](/packages/jbc-php-cron/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

php-cron
========

[](#php-cron)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Native PHP cron scheduler — no crontab required.

A pure PHP task scheduler that does not depend on the system crontab. Perfect for PHP applications that need to run periodic tasks without additional server configuration.

Requirements
------------

[](#requirements)

- PHP 8.1+
- `pcntl` extension

Installation
------------

[](#installation)

```
composer require jbc/php-cron
```

Basic usage
-----------

[](#basic-usage)

```
use Jbc\PhpCron\Scheduler;

$scheduler = new Scheduler(
    timezone: new \DateTimeZone('America/Sao_Paulo'),
);

$scheduler->schedule('* * * * *', function () {
    echo 'Runs every minute' . PHP_EOL;
});

$scheduler->schedule('0 9 * * *', function () {
    echo 'Runs every day at 9am' . PHP_EOL;
});

$scheduler->run();
```

Supported expressions
---------------------

[](#supported-expressions)

ExpressionDescription`* * * * *`Every minute`*/5 * * * *`Every 5 minutes`0 9 * * *`Every day at 9am`0 9 * * 1-5`Weekdays at 9am`0 0 1 * *`First day of every month`@hourly`Every hour`@daily`Every day at midnight`@weekly`Every week`@monthly`Every monthJob options
-----------

[](#job-options)

```
$scheduler
    ->schedule('* * * * *', fn() => myFunction())
    ->name('my-job')
    ->withoutOverlapping()
    ->onlyIf(fn() => true)
    ->onError(fn(\Throwable $e) => logger($e));
```

MethodDescription`->name('name')`Sets a unique name for the job`->withoutOverlapping()`Prevents simultaneous execution of the same job`->onlyIf(callable)`Only runs if the condition returns true`->onError(callable)`Catches errors without stopping the schedulerRunning
-------

[](#running)

```
php bin/cron
```

Production with Supervisor
--------------------------

[](#production-with-supervisor)

```
[program:php-cron]
command=php /var/www/html/php-cron/bin/cron
autostart=true
autorestart=true
stderr_logfile=/var/log/php-cron.err.log
stdout_logfile=/var/log/php-cron.out.log
```

License
-------

[](#license)

MIT © [João Bonifacio](https://github.com/joaomboni)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance81

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

98d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10442229?v=4)[Joseph Bonifacio](/maintainers/jbonifacio)[@JBonifacio](https://github.com/JBonifacio)

---

Top Contributors

[![joaomboni](https://avatars.githubusercontent.com/u/74162506?v=4)](https://github.com/joaomboni "joaomboni (7 commits)")

### Embed Badge

![Health badge](/badges/jbc-php-cron/health.svg)

```
[![Health](https://phpackages.com/badges/jbc-php-cron/health.svg)](https://phpackages.com/packages/jbc-php-cron)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M600](/packages/shopware-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19566.0M1.8k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M425](/packages/drupal-core-recommended)[oro/platform

Business Application Platform (BAP)

645143.5k116](/packages/oro-platform)

PHPackages © 2026

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