PHPackages                             dapphp/radius - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. dapphp/radius

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

dapphp/radius
=============

A pure PHP RADIUS client based on the SysCo/al implementation

3.1.0(5mo ago)841.0M—2%48[4 issues](https://github.com/dapphp/radius/issues)[2 PRs](https://github.com/dapphp/radius/pulls)1LGPL-3.0-or-laterPHPPHP ^7.3 || ^8.0CI failing

Since Apr 1Pushed 5mo ago9 watchersCompare

[ Source](https://github.com/dapphp/radius)[ Packagist](https://packagist.org/packages/dapphp/radius)[ Docs](https://github.com/dapphp/radius)[ RSS](/packages/dapphp-radius/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (6)Dependencies (1)Versions (16)Used By (1)

[![Build Status](https://camo.githubusercontent.com/186bd1b56c847cb375e0d7ae5ed5536dd5d6cbc58f83bfb56d53f454d1848a4b/68747470733a2f2f6170702e7472617669732d63692e636f6d2f6461707068702f7261646975732e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/github/dapphp/radius)[![Total Downloads](https://camo.githubusercontent.com/50214f313890485f6b3fda5d02ef44adb23779951a34eebfde20a5928f8fce95/68747470733a2f2f706f7365722e707567782e6f72672f6461707068702f7261646975732f646f776e6c6f616473)](https://packagist.org/packages/dapphp/radius)[![Latest Stable Version](https://camo.githubusercontent.com/5085842fca245c5c54cf8a5f7e7c66ab6feb75bfc74ea12af1b39533bc42b7cd/68747470733a2f2f706f7365722e707567782e6f72672f6461707068702f7261646975732f762f737461626c65)](https://packagist.org/packages/dapphp/radius)

Name
----

[](#name)

**Dapphp\\Radius** – A pure PHP RADIUS client based on the SysCo/al implementation

Author
------

[](#author)

- Drew Phillips
- SysCo/al  ()

Description
-----------

[](#description)

**Dapphp\\Radius** is a pure PHP RADIUS client for authenticating users against a RADIUS server in PHP. It currently supports basic RADIUS auth using PAP, CHAP (MD5), MSCHAP v1, MSCHAP v2, and EAP-MSCHAP v2, accounting (RFC 2866), and Dynamic Authorization CoA and Disconnect requests (RFC 5176).

The library has been tested to work with the following RADIUS servers:

- Microsoft Windows Server 2019 Network Policy Server
- Microsoft Windows Server 2016 Network Policy Server
- Microsoft Windows Server 2012 Network Policy Server
- FreeRADIUS 2, 3, 3.2

PAP authentication has been tested on:

- Microsoft Radius server IAS
- Mideye RADIUS Server
- Radl
- RSA SecurID
- VASCO Middleware 3.0 server
- WinRadius
- ZyXEL ZyWALL OTP

The PHP openssl extension is required if using MSCHAP v1 or v2. For older PHP versions that have mcrypt without openssl support, then mcrypt is used.

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

[](#installation)

The recommended way to install `dapphp/radius` is using [Composer](https://getcomposer.org). If you are already using composer, simple run `composer require dapphp/radius` or add `dapphp/radius` to your composer.json file's `require` section.

For PHP 7.3 and later use the 3.x branch, and use the 2.x branch for PHP 7.2 and earlier.

Standalone installation is also supported and a SPL autoloader is provided. (Don't use the standalone autoloader if you're using Composer!).

To install standalone, download the release archive and extract to a location on your server. In your application, `require_once 'radius/autoload.php';` and then you can use the class.

Examples
--------

[](#examples)

See the `examples/` directory for working examples. The RADIUS server address, secret, and credentials are read from environment variables and default to:

```
RADIUS_SERVER_ADDR=192.168.0.20
RADIUS_USER=nemo
RADIUS_PASS=arctangent
RADIUS_SECRET=xyzzy5461

```

To print RADIUS debug info, specify the `-v` option.

Example:

```
RADIUS_SERVER_ADDR=10.0.100.1 RADIUS_USER=radtest php example/client.php -v

```

Synopsis
--------

[](#synopsis)

```
