简体   繁体   中英

PHP extension Dio is not loaded?

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:

  1. I downloaded the direct io from the pecl website
  2. Then I copied the php_dio.dll into the PHP/ext folder
  3. Next, I edited the php.ini file by adding the extension=php_dio.dll
  4. Then I restarted my XAMPP webserver
  5. I opened 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM