I am trying to communicate with the COM Ports using the DIO extension, but it's not working it seems. I have already added the .dll file into my ext folder but I still can't find the Dio support enabled in PHP info(). I have already restarted my XAMPP server more than twice, but still, it's not working. This is my current code for the com port testing.
$portName = 'COM9:';
$baudRate = 9600;
$bits = 8;
$spotBit = 1;
header( 'Content-type: text/plain; charset=utf-8' );
?>
Serial Port Test
================
<?php
function echoFlush($string)
{
echo $string . "\n";
flush();
ob_flush();
}
if(!extension_loaded('dio'))
{
echoFlush( "PHP Direct IO does not appear to be installed for more info see: http://www.php.net/manual/en/book.dio.php" );
exit;
}
This is the error I am getting now.
PHP Direct IO does not appear to be installed for more info see: http://www.php.net/manual/en/book.dio.php
This is the steps I followed while installing the extension:
php_dio.dll
into the PHP/ext folderphp.ini
file by adding the extension=php_dio.dll
php_info()
to check out the php_dio.dll
and found that it is not still loaded.您是否在phpinfo()
输出中检查了extension_dir
指令?
尝试使用 PHP 7.2 版,它适用于我,但不适用于 7.3 版。
We got confused with the XAMPP architecture version with Windows. It worked after installing the right. Thank you guys.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.