1. Go to this page and download the library: Download php-io-extensions/uart library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php-io-extensions / uart example snippets
use Fd\FD;
use Uart\UARTConfig;
use Uart\UARTUse;
$fd = FD::open('/dev/ttyUSB0', 2); // O_RDWR = 2
// configure, then read/write ...
FD::close($fd);