RE: [PHP] Com Port Access - Take 2
| From: | Matthias Endler | Date: | Wed, 18 Oct 2000 05:55:51 +0000 |
| Subject: | RE: [PHP] Com Port Access - Take 2 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20797@lists.php.net to get a copy of this message | ||
Hi Chris,
> Sorry about the double message. I was kindly reminded I left off some
> valuable info (OS type etc) so here is the email again with the info
>
> __________________________________________________________________
> ___________
>
> Ive been looking and have not been successful in finding any
> answers, so I
> figured I would see if anyone on the list has had any success.
>
> What I want to be able to do is, from a PHP script, access the
> servers com
> port. I have a unit attached to the com port of a FreeBSD 3.4 Stable box
> running PHP 4.0b4, and want to be able to send it data, based on a php
> script (and associated form).
>
> If anyone can point me in the right direction of where to start looking,
> that would be great.
there are two approaches to your problem.
(1) the easy way
You have a commandline tool to control the device on serialport, then you
can simply use PHP's popen()-function
(http://au.php.net:81/manual/function.popen.php).
(2) the hard way
You write your own php-extension. This needs a solid understanding of the
Zend API and of course you should know how to program in C
(http://www.zend.com/zend/api.php).
Cheers,
Matthias