In php, there is something called a serial port. I don’t know if you have heard of it. Today I will show you how to configure the serial port to connect to dio in php7. You can refer to it if you need it.
Due to project reasons, communication with hardware is required. The customer just said that the serial port would be connected. But I don’t know what a serial port is. I think there should be ready-made software that can handle it. Hey, I’ll come back and do it. It's actually quite troublesome.
After checking, there are currently only these versions of PHP that support serial ports (PHP 4 >= 4.2.0, PHP 5
Originally I wanted to use 5.6 to add extensions, but seeing that php7 supports it, I didn’t have to worry so much. Directly changed php to 7.
After downloading php7 and configuring the environment, I used the window local machine to test and found that php_dio.dll was missing.
You can only find it. For windows, you can download the dll directly here, http://pecl.php.net/package/dio/0.1.0/windows,
When downloading Remember to look clearly and it must match your own PHP. If you choose thread safety, choose thread safety. If it is not safe, choose unsafe.
After downloading, unzip it and put the two dlls inside into the ext folder in your php folder.
You can also choose other versions for this address.
http://pecl.php.net/package/dio
By the way, after doing it, you can write a code to test it. As for the code, I also read other people’s code. You can go to this address to read it.
http://blog.csdn.net/yuyouwen123456/article/details/20151011
If you don’t have hardware and want to test the serial port, you can download Configure Virtual Serial Port Driver to simulate the serial port, and then use the serial port assistant to send data. This way you can test it on your PC.
Recommended learning: php video tutorial
The above is the detailed content of How to configure serial port connection dio in php7. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Zend Studio 13.0.1
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.
