You can pass the following settings to MphpD when initializing it:

use FloFaber\MphpD\MphpD;
$mphpd = new MphpD([
  "host" => "",
  "port" => 6600,
  "timeout" => 5,
  "password" => "beetlejuice",
  "binarylimit" => 8192

All of those are optional. If one is not specified the default value is used. See below.


String. Specifies the IP to which MphpD should connect.

If prefixed with unix: the path to MPD's Unix socket. Example: unix:/var/run/mpd.sock



Int. The port on which MPD is listening.

Default: 6600


Int. Defines the connect-, read- and write-timeout in seconds.

Default: 1


String. The plaintext password used for authentication on MPD.

Default: empty string


Int. The maximum number of bytes a binary chunk returned by MPD can have.

A bigger value means less overhead. Don't change it if you don't experience any problems with the default value.

Only supported on MPD v0.22.4 and newer. It's simply ignored and set to 8192 on older versions.

Default: 8192

© 2023 Florian Faber