# php-opcua > Pure PHP OPC UA ecosystem for industrial automation and IoT. Connect PHP applications to PLCs, SCADA systems, sensors, and historians — no C/C++ extensions, no HTTP gateways, just PHP and ext-openssl. Website: https://www.php-opcua.com GitHub: https://github.com/php-opcua License: MIT ## What is OPC UA OPC UA (Open Platform Communications Unified Architecture) is the industry standard protocol for secure, reliable communication in industrial automation and IoT. It connects PLCs, SCADA systems, sensors, robots, CNC machines, building automation, and more. php-opcua brings this protocol to PHP with a complete native binary implementation. ## Packages ### Core - **opcua-client** — Pure PHP OPC UA binary protocol client. Browse, read, write, method calls, subscriptions, history read, events, alarms, type discovery. 10 security policies (6 RSA + 4 ECC), 3 auth modes, auto-retry, fluent builders, PSR-3/14/16 integration. - Docs: https://www.php-opcua.com/opcua-client/documentation - GitHub: https://github.com/php-opcua/opcua-client - Packagist: https://packagist.org/packages/php-opcua/opcua-client - llms.txt: https://www.php-opcua.com/llms/opcua-client/llms.txt - llms-full.txt: https://www.php-opcua.com/llms/opcua-client/llms-full.txt - llms-skills.md: https://www.php-opcua.com/llms/opcua-client/llms-skills.md - **opcua-session-manager** — ReactPHP daemon that keeps OPC UA sessions alive across PHP request cycles via Unix socket IPC. Reduces per-request overhead from ~150ms to ~5ms. - Docs: https://www.php-opcua.com/opcua-session-manager/documentation - GitHub: https://github.com/php-opcua/opcua-session-manager - Packagist: https://packagist.org/packages/php-opcua/opcua-session-manager - llms.txt: https://www.php-opcua.com/llms/opcua-session-manager/llms.txt - llms-full.txt: https://www.php-opcua.com/llms/opcua-session-manager/llms-full.txt - llms-skills.md: https://www.php-opcua.com/llms/opcua-session-manager/llms-skills.md - **opcua-client-nodeset** — Pre-generated PHP classes from 51 OPC Foundation companion specifications. 338 enums, 191 typed DTOs, 191 binary codecs. Covers DI, Robotics, MachineTool, BACnet, MTConnect, ISA-95, PackML, and more. - Docs: https://www.php-opcua.com/opcua-client-nodeset/documentation - GitHub: https://github.com/php-opcua/opcua-client-nodeset - Packagist: https://packagist.org/packages/php-opcua/opcua-client-nodeset - **opcua-cli** — Command-line tool for browsing servers, reading/writing nodes, watching values in real-time, managing trust stores, exporting address spaces, and generating PHP code from NodeSet2.xml. - Docs: https://www.php-opcua.com/opcua-cli/documentation - GitHub: https://github.com/php-opcua/opcua-cli - Packagist: https://packagist.org/packages/php-opcua/opcua-cli - llms.txt: https://www.php-opcua.com/llms/opcua-cli/llms.txt - llms-full.txt: https://www.php-opcua.com/llms/opcua-cli/llms-full.txt - llms-skills.md: https://www.php-opcua.com/llms/opcua-cli/llms-skills.md ### Framework Integrations - **laravel-opcua** — Laravel service provider with Facade (`Opcua::read()`), named connections, Artisan commands, automatic PSR-3/14/16 injection, session manager daemon, and transparent session persistence. - Docs: https://www.php-opcua.com/laravel-opcua/documentation - GitHub: https://github.com/php-opcua/laravel-opcua - Packagist: https://packagist.org/packages/php-opcua/laravel-opcua - llms.txt: https://www.php-opcua.com/llms/laravel-opcua/llms.txt - llms-full.txt: https://www.php-opcua.com/llms/laravel-opcua/llms-full.txt - llms-skills.md: https://www.php-opcua.com/llms/laravel-opcua/llms-skills.md - **symfony-opcua** — Symfony bundle with dependency injection, YAML configuration, console commands, Monolog integration, and session manager support. - Docs: https://www.php-opcua.com/symfony-opcua/documentation - GitHub: https://github.com/php-opcua/symfony-opcua - Packagist: https://packagist.org/packages/php-opcua/symfony-opcua - llms.txt: https://www.php-opcua.com/llms/symfony-opcua/llms.txt - llms-full.txt: https://www.php-opcua.com/llms/symfony-opcua/llms-full.txt - llms-skills.md: https://www.php-opcua.com/llms/symfony-opcua/llms-skills.md ### Testing - **uanetstandard-test-suite** — Docker-based OPC UA test infrastructure built on the OPC Foundation's UA-.NETStandard reference implementation. 8 pre-configured servers, ~270 test nodes. - Docs: https://www.php-opcua.com/uanetstandard-test-suite/documentation - GitHub: https://github.com/php-opcua/uanetstandard-test-suite ## Quick Start ```bash composer require php-opcua/opcua-client ``` Requirements: PHP 8.2+ and ext-openssl. ```php use PhpOpcua\Client\ClientBuilder; $client = ClientBuilder::create() ->connect('opc.tcp://localhost:4840'); $value = $client->read('ns=2;s=Temperature'); echo $value->getValue(); $client->disconnect(); ``` ### With Laravel ```bash composer require php-opcua/laravel-opcua ``` ```php use PhpOpcua\LaravelOpcua\Facades\Opcua; $temperature = Opcua::read('ns=2;s=Temperature'); ``` ## Architecture ``` Your Application | +-- laravel-opcua or symfony-opcua Framework integration | | | +-- opcua-session-manager Persistent sessions (optional) | | | +-- opcua-client Binary protocol, crypto, I/O | | | +-- opcua-client-nodeset Type definitions (optional) | +-- opcua-cli Developer tooling ``` ## Security Policies | Policy | Type | Status | |--------|------|--------| | None | — | Stable | | Basic128Rsa15 | RSA | Deprecated (functional) | | Basic256 | RSA | Deprecated (functional) | | Basic256Sha256 | RSA | Stable | | Aes128_Sha256_RsaOaep | RSA | Stable | | Aes256_Sha256_RsaPss | RSA | Stable | | ECC_nistP256 | ECC | Candidate | | ECC_nistP384 | ECC | Candidate | | ECC_brainpoolP256r1 | ECC | Candidate | | ECC_brainpoolP384r1 | ECC | Candidate | ## Key Numbers - 147,000 lines of PHP - 2,649 tests / 5,204 assertions - 99.5% test coverage - 47 PSR-14 events - 51 companion specification types - 807 generated PHP classes - Zero C extension dependencies - PHP 8.2 through 8.5 ## Links - Website: https://www.php-opcua.com - Documentation: https://www.php-opcua.com/opcua-client/documentation - GitHub Organization: https://github.com/php-opcua - Packagist: https://packagist.org/packages/php-opcua/ - About: https://www.php-opcua.com/about