Passing data between PHP and C executable in linux

前端 未结 4 543
迷失自我
迷失自我 2021-01-12 15:12

Under Linux ,if I want to pass pure string from PHP to C, how do i do that? what I\'ve tried do far is:

exec(\"./myexec.bin -a mystring\");

4条回答
  •  深忆病人
    2021-01-12 15:30

    If it is more like a data structure than a string, what about using an embedded webserver? At first sight it may sound like overkill for your purpose, but mongoose for example is a very lightweight embeddable webserver:

    http://code.google.com/p/mongoose/

    There's also a nice tutorial about the exact same problem you have, transfering data between a PHP application and a C/C++ application. It's in german, though ... but maybe google translator can help:

    http://blog.aditu.de/2010/05/15/serverbridge-zwischen-php-und-cc/

提交回复
热议问题