I search someone who would have already used the class DOTNET to communicate with a COM port. In a e-Health PHP Project, I search to obtain datas from a smart card. After to be fallen on several methods reserved to Linux, I found this DOTNET class allowed to access to a port to communicate with an external device.
$serial = new DOTNET('system', 'System.IO.Ports.SerialPort');
$serial->PortName = 'COM8';
$serial->Open();
I modified the file php.ini as indicated on another forum to uncomment these three lines, but it seems it's not enough :
extension=php_com_dotnet.dll
extension_dir = "ext"
enable_dl = On
When trying to open connection, Wamp send me the following error message :
Fatal error: in C:\wamp64\www\node-project\patients.php on line 204
com_exception: in C:\wamp64\www\node-project\patients.php on line 204
Please refer to the comments on this page.
PHP: dotnet - Manual
juan156_elias at gmail dot com
You can't use the .NET API directly as you mentioned in the question article, you have to create and register a COM visible wrapper using .NET 3.5 or lower framework and call it.