Skip to main content

Posts

Showing posts with the label PHPhD

PHPhD – Server side hardware port access extension for PHP

In one of my project I need to access PC hardware ports using PHP. Standard distribution of PHP (PHP for Windows) may not have facilities to access PC/Server hardware ports, and finally I developed lightweight PHP extension to access server hardware ports. Current version of PHPhD (version 1.0.0.20) support for PHP 5.2.x (tested with PHP 5.2.1) and distributed under the terms and conditions of Mozilla Public License version 1.1. This PHP extension is available to download at http://elect.wikispaces.com/Downloads Using PHPhD users can access server hardware ports with minimum amount of coding and complexity. Example PHP source code which was based on PHPhD is listed in below, //Initialize and open hardware device driver if(!phphd_open_driver()) { die("Unable to open PHP hardware port access device driver"); } //read printer (LPT) port and get the curent port value $lpt_port_val = phphd_read_port(0x378+1); echo("LPT port value [0x378+1] : ". $lpt_po...