We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


php can used to connect mobile phone in the comport ?

ftpphptest1 asked
Medium Priority
Last Modified: 2013-12-13
i find a php script used for connect to the comport, can anyone give the explanation of the code?

also, if i can connect to the comport by php, can i use it to control the mobile to send message? thx

exec('mode COM1: baud=19200 data=8 stop=1 parity=n');   
$fd = dio_open('COM1:', O_RDWR);   
while (1) {   
    $data = dio_read($fd, 1);   
    if ($data) {   
        echo $data;   

Open in new window

Watch Question

This code opens a file named COM1:. It would only open a serial port if you had a device named COM1:, which is likely only going to work on PHP for Windows. It then oddly creates a file handle for read write, and then only reads from the file handle until no more data is available to be read and then closes the file handle.


It's unlikely that your mobile phone would have a serial interface for sending SMS messages unless it was running Windows Mobile and you wrote the Interface yourself.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.