PHPackages                             bashaus/solo-php - 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. bashaus/solo-php

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

bashaus/solo-php
================

Prevents multiple cron instances from running simultaneously

73.0k1PHP

Since Dec 6Pushed 12y agoCompare

[ Source](https://github.com/bashaus/solo-php)[ Packagist](https://packagist.org/packages/bashaus/solo-php)[ RSS](/packages/bashaus-solo-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Solo
====

[](#solo)

Prevents two of the same cronjobs from running at the same. It is useful with cron to make sure that a job doesn't run before a previous one has finished.

This script is a port of the original [solo](http://timkay.com/solo/) bash script written by [Tim Kay](http://timkay.com/). It has been ported to PHP to make it available on Windows servers.

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

[](#installation)

Add the following to your composer.json.

```
{
    "require": {
        "bashaus/solo-php": "dev-master"
    },
    "config": {
        "bin-dir" : "bin"
    }
}

```

Usage
-----

[](#usage)

```
bin/solo [port] [exec*]

```

- Argument `port` is an arbitrary port number to lock
- Argument `exec` is a shell command to run

You can use it with cron like this:

```
* * * * * cd ...; bin/solo 24601 ./task.php arg1 arg2 arg3

```

The script task.php run every minute, but only if the previous invocation has finished. You can use any parameters, it doesn't have to run it every minute.

Further reading
---------------

[](#further-reading)

Take a look at Tim Kay's [documentation](http://timkay.com/solo/) for more use cases and how to use solo.

Contributors
------------

[](#contributors)

- [Tim Kay](http://www.timkay.com) - Original concept
- [Bashkim Isai](http://www.bashkim.com.au) - PHP port

If you fork this project and create a pull request add your GitHub username, your full name and website to the end of list above.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/444f859a38abc4b29f2847bd72fa4529a7d9f6ec43625f677b62301629c8c3a7?d=identicon)[bashaus](/maintainers/bashaus)

### Embed Badge

![Health badge](/badges/bashaus-solo-php/health.svg)

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

###  Alternatives

[tysonandre/var_representation_polyfill

Polyfill for var\_representation: convert a variable to a string in a way that fixes the shortcomings of var\_export

146.4M](/packages/tysonandre-var-representation-polyfill)

PHPackages © 2026

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