PHPackages                             wikimedia/deadlinkchecker - 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. wikimedia/deadlinkchecker

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

wikimedia/deadlinkchecker
=========================

Library for checking if a given link is dead or alive

v1.8.3.7(2y ago)256.2k↓25.9%3GPL-3.0-or-laterPHPPHP &gt;=7.3.0

Since Sep 8Pushed 2y ago11 watchersCompare

[ Source](https://github.com/wikimedia/DeadlinkChecker)[ Packagist](https://packagist.org/packages/wikimedia/deadlinkchecker)[ Docs](https://www.mediawiki.org/wiki/DeadlinkChecker)[ RSS](/packages/wikimedia-deadlinkchecker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (33)Used By (0)

DeadlinkChecker
===============

[](#deadlinkchecker)

Maintainer: [Cyberpower678](https://github.com/Cyberpower678)

REQUIRES: PHP 7.3 or higher

This is a PHP library for detecting whether URLs on the internet are alive or dead via cURL. It includes the following features:

- Supports HTTP, HTTPS, FTP, MMS, and RTSP URLs
- Supports TOR
- Supports [internationalized domain names](https://en.wikipedia.org/wiki/Internationalized_domain_name)
- Basic detection for [soft 404s](https://en.wikipedia.org/wiki/HTTP_404#Soft_404_errors)
- For optimized performance, it initially performs a header-only page request (CURLOPT\_NOBODY). If that request fails, it then tries to do a normal full body page request.
- Concurrently checks batch of URLs for efficiency

### Overview

[](#overview)

The checkIfDead library is a PHP library designed for assessing the status of URLs on the web and dark web. It operates by taking one or more URLs as inputs and concurrently checks them, to enhance response times.

It can handle both properly and improperly formatted URLs and performs basic sanity checking and error correction on malformed inputs. All inputs are normalized through the sanitizer to ensure the curl library communicates properly with the target.

When left at defaults, the library will emulate a web browser request and follow redirects to its destination.

### Installation

[](#installation)

Using composer: Add the following to the composer.json file for your project:

```
{
  "require": {
     "wikimedia/deadlinkchecker": "dev-master"
  }
}

```

And then run 'composer update'.

Or using git:

```
$ git clone https://github.com/wikimedia/DeadlinkChecker.git

```

### Basic Usage

[](#basic-usage)

##### For checking a single link:

[](#for-checking-a-single-link)

```
$deadLinkChecker = new checkIfDead();
$url = 'https://en.wikipedia.org';
$exec = $deadLinkChecker->isLinkDead( $url );
echo var_export( $exec );

```

Prints:

```
false

```

##### For checking an array of links:

[](#for-checking-an-array-of-links)

```
$deadLinkChecker = new checkIfDead();
$urls = [ 'https://en.wikipedia.org/nothing', 'https://en.wikipedia.org' ];
$exec = $deadLinkChecker->areLinksDead( $urls );
echo var_export( $exec );

```

Prints:

```
array (
  'https://en.wikipedia.org/nothing' => true,
  'https://en.wikipedia.org' => false,
)

```

Note that these functions will return `null` if they are unable to determine whether a link is alive or dead.

### Advanced Usage

[](#advanced-usage)

You can control how long it takes before page requests timeout by passing parameters to the constructor. To set the header-only page requests to a 10 second timeout and the full page requests to a 20 second timeout, you would use the following:

```
$deadLinkChecker = new checkIfDead( 10, 20 );

```

In addition to controlling query timeouts, a custom user agent can be passed to the library as well like so:

```
$deadLinkChecker = new checkIfDead( 10, 20, "Custom Agent" );

```

By default, multiple URLs of the same domain are queued sequentially to be respectul to the hosts. However, this can be disabled so all URLs are queried concurrently as follows:

```
$deadLinkChecker = new checkIfDead( 10, 20, "Custom Agent", false );

```

You can increase the verbosity of the output to follow what the library is doing as it's doing it.

```
$deadLinkChecker = new checkIfDead( 10, 20, "Custom Agent", true, true );

```

Finally, because the library supports TOR requests, the environment will need a working SOCKS5 proxy to make the requests. The library looks for the SOCKS5 proxy using system defaults, but the proxy can be specified manually.

```
$deadLinkChecker = new checkIfDead( 10, 20, "Custom Agent", true, false, "proxy.host", proxy_port );

```

### Getting details about the last batch of URLs checked

[](#getting-details-about-the-last-batch-of-urls-checked)

After a batch of URLs have been checked, you can use `$deadLinkChecker->getErrors()` to get the curl errors encountered during the process, and `$deadLinkChecker->getRequestDetails()` to get the curl request details of all URLs checked in the last batch.

### Other functions

[](#other-functions)

To clean up dirty URLs and allow them to be normalized to correctly line with varying HTTP clients:

```
$deadLinkChecker->sanitizeURL( "https://example.com/", $stripFragment );

```

By default, $stripFragment is false. When set to true, URL fragments are dropped.

Because PHP has a tendency to fail parsing URLs containing UTF-8 characters, you can use the library's parseURL method.

```
$deadLinkChecker->parseURL( $url );

```

### License

[](#license)

This code is distributed under [GNU GPLv3+](https://www.gnu.org/copyleft/gpl.html)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 66.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

Every ~83 days

Recently: every ~164 days

Total

32

Last Release

972d ago

PHP version history (3 changes)v1.0.0PHP &gt;=5.5.9

v1.8.3.1PHP &gt;=7.0.0

v1.8.3.5PHP &gt;=7.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/716c86d71cbf921e7912a505f89d799de398fc0a3af0bd4c8862834b2d642bd7?d=identicon)[wikimedia](/maintainers/wikimedia)

![](https://www.gravatar.com/avatar/38c4783fedc6910ede916dea04308b6c553dd232a1f729a05d0caccb3e4e4ddd?d=identicon)[Niharika](/maintainers/Niharika)

![](https://www.gravatar.com/avatar/d23b004bd22a9b1062ae5256e4a616277f67f2ce5e4c39ff3e2bda89137f91b4?d=identicon)[kaldari](/maintainers/kaldari)

---

Top Contributors

[![cyberpower678](https://avatars.githubusercontent.com/u/1476075?v=4)](https://github.com/cyberpower678 "cyberpower678 (155 commits)")[![kaldari](https://avatars.githubusercontent.com/u/1707155?v=4)](https://github.com/kaldari "kaldari (37 commits)")[![TransformedModel](https://avatars.githubusercontent.com/u/269515173?v=4)](https://github.com/TransformedModel "TransformedModel (28 commits)")[![bd808](https://avatars.githubusercontent.com/u/6469?v=4)](https://github.com/bd808 "bd808 (12 commits)")[![MusikAnimal](https://avatars.githubusercontent.com/u/366374?v=4)](https://github.com/MusikAnimal "MusikAnimal (1 commits)")

---

Tags

linkdeadlink

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wikimedia-deadlinkchecker/health.svg)

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

###  Alternatives

[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6737.4M62](/packages/jbroadway-urlify)[misd/linkify

Converts URLs and email addresses in text into HTML links

1122.9M10](/packages/misd-linkify)[iamcal/lib_autolink

Adds anchors to urls in a text

631.3M3](/packages/iamcal-lib-autolink)[shivella/laravel-bitly

Laravel package for generating bitly url

75789.0k1](/packages/shivella-laravel-bitly)[voku/urlify

PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.

254.1M7](/packages/voku-urlify)[asika/autolink

Auto convert url to link anchor.

34454.0k2](/packages/asika-autolink)

PHPackages © 2026

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