PHP Classes

Pure PHP PJLink class: Control data projectors via socket connections

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 105 All time: 9,657 This week: 190Up
Version License PHP version Categories
pjlink 2.0.1GNU Lesser Genera...5Networking


This class can control data projectors via socket connections.

It can connect to a data projector connecting to its IP address and sending certain commands.

Currently the class can send commands for turning the power on or off, get the power state, set or get the input, get the error and lamp state, get the name of the device, product and manufacturer, device class and other information.

Innovation Award
PHP Programming Innovation award nominee
May 2017
Number 2
PJLink is a unified standard for operating and controlling data projectors via IP network connections.

This class can control data projectors that support PJLink.

Manuel Lemos
Picture of André Liechti
  Performance   Level  
Name: André Liechti <contact>
Classes: 9 packages by
Country: Switzerland Switzerland
Age: 54
All time rank: 4016 in Switzerland Switzerland
Week rank: 57 Up1 in Switzerland Switzerland Up
Innovation award
Innovation award
Nominee: 8x

Winner: 2x


Pure PHP PJLink library

The PJLink PHP class is the lightest pure PHP package available for operating and controlling data projectors using the PJLink Class1 and Class 2 standard.

PJLink Class1 specifications are available here:

PJLink Class2 specifications are available here:

PJLink test software is available gere:

(c) 2017-2019 SysCo systemes de communication sa

Current build: (2019-03-13)

No external file is needed (no PEAR, no PECL, no cURL).

Change Log

2019-03-13 tomatow Lower case response are now accepted
2017-09-05 SysCo/al First public Class2 support
2017-04-24 SysCo/al First public version
2017-04-23 SysCo/al Initial implementation


Copyright (c) 2017-2019 SysCo systemes de communication sa SysCo (tm) is a trademark of SysCo systemes de communication sa ( All rights reserved.

PJLink PHP class is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PJLink PHP class is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with PJLink PHP class. If not, see <>.


Every command send to the projector return false is something is wrong. The error message can be detailed by calling the getError() method.

Public methods available:

  # Class1/2 functions
   setDevice($host, [[[$password], $timeout], $port])
   powerOn([[[[$host], $password], $timeout], $port])
   powerOff([[[[$host], $password], $timeout], $port])
   getPowerState([[[[$host], $password], $timeout], $port])
   setInput($input, [[[[$host], $password], $timeout], $port])
   getInput([[[[$host], $password], $timeout], $port])
   muteVideoOn([[[[$host], $password], $timeout], $port])
   muteVideoOff([[[[$host], $password], $timeout], $port])
   muteAudioOn([[[[$host], $password], $timeout], $port])
   muteAudioOff([[[[$host], $password], $timeout], $port])
   muteVideoAudioOn([[[[$host], $password], $timeout], $port])
   muteVideoAudioOff([[[[$host], $password], $timeout], $port])
   getMuteState([[[[$host], $password], $timeout], $port])
   getErrorState([[[[$host], $password], $timeout], $port])
   getLampState([[[[$host], $password], $timeout], $port])
   getInputList([[[[$host], $password], $timeout], $port])
   getName([[[[$host], $password], $timeout], $port])
   getManufactureName([[[[$host], $password], $timeout], $port])
   getProductName([[[[$host], $password], $timeout], $port])
   getOtherInfo([[[[$host], $password], $timeout], $port])
   getClass([[[[$host], $password], $timeout], $port])
  # Class2 only functions
   getSerialNumber([[[[$host], $password], $timeout], $port])
   getSoftwareVersion([[[[$host], $password], $timeout], $port])
   getInputTerminalName($input, [[[[$host], $password], $timeout], $port])
   getInputResolution([[[[$host], $password], $timeout], $port])
   getRecommendedResolution([[[[$host], $password], $timeout], $port])
   getFilterUsage([[[[$host], $password], $timeout], $port])
   getLampReplacementModel([[[[$host], $password], $timeout], $port])
   getFilterReplacementModel([[[[$host], $password], $timeout], $port])
   setSpeakerVolume($volume, [[[[$host], $password], $timeout], $port])
   setMicrophoneVolume($volume, [[[[$host], $password], $timeout], $port])
   freezeOn([[[[$host], $password], $timeout], $port])
   freezeOff([[[[$host], $password], $timeout], $port])
   getFreezeState([[[[$host], $password], $timeout], $port])


// Example 1

  $pjlink = new PJLink();
  if (false === $pjlink->powerOn("")) {
    echo $pjlink->getError();
  } elseif (false === $pjlink->setInput(11, "")) {
    echo $pjlink->getError();

// Example 2

  $pjlink = new PJLink(1);
  $pjlink->setDevice("", "my_pjlink_pass", 10, 4352);
  if (false === $pjlink->powerOn()) {
    echo $pjlink->getError();
  } elseif (false === $pjlink->setInput(11)) {
    echo $pjlink->getError();
  echo "Device: ".$pjlink->getManufactureName().", ".$pjlink->getProductName()."<br />\n";

// Example 3

  $pjlink = new PJLink(2);
  $pjlink->setDevice("", "my_pjlink_pass", 10, 4352);
  if (false === $pjlink->powerOn()) {
    echo $pjlink->getError();
  } elseif (false === $pjlink->setInput(11)) {
    echo $pjlink->getError();
  echo "Device: ".$pjlink->getManufactureName().", ".$pjlink->getProductName()."<br />\n";

The test.class.php file will test all methods of the class. It can be used with the PJLink test software.

You can support our open source projects with donations and sponsoring. Sponsorships are crucial for ongoing and future development! If you'd like to support our work, then consider making a donation, any support is always welcome even if it's as low as $1! You can also sponsor the development of a specific feature. Please contact us in order to discuss the detail of the implementation.

Donate via PayPal by clicking here Donate via PayPal

And for more PHP classes, have a look on, where a lot of authors are sharing their classes for free.

  Files folder image Files  
File Role Description
Accessible without login Plain text file Lic. License text
Plain text file pjlink.class.php Class Class source
Accessible without login Plain text file Doc. Documentation
Accessible without login Plain text file test.class.php Example Example script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,657
This week:190Up