从网站(PHP)调用C函数 [英] Call a C function from a website (PHP)

查看:111
本文介绍了从网站(PHP)调用C函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下问题.

我有一个在Linux(Ubuntu 2.6)上运行的C脚本,用于控制设备.我必须为此功能创建一个遥控器(以网站形式).

我可以在同一台服务器上托管一个网站,但是如何获得一个PHP脚本来调用/执行C脚本?
(JS也可以,但是我真的不知道如何使用它,而且时间很短)

在此先感谢

I got the following problem.

I have a C script running on linux (Ubuntu 2.6), that controls a device. I have to create a remote control (in form of a website) for this function.

I can host a website on the same server, but how do I get a PHP script to call/execute the C script?
(JS would work too,but I dont really have an idea how to work with it and am low on time)

Thanks in advance

推荐答案

PHP具有一些功能 [ ^ ]用于执行外部程序.功能的选择主要取决于您要对程序的输出执行什么操作.
PHP has several functions[^] for executing external programs. The choice of function mainly depends on what you want to do with the output of the program.


这篇关于从网站(PHP)调用C函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆