How to call c program from php?

editAnswer

reportReport

Answer(s) available: 5

Aahva Pandya

, Journalist, Partnerships Business Requirements Spelling

You should compile to binary your C program before, an then execute it with PHP. PHP will not compile your C code. The php exec function just execute a command like you will do on your shell (or cmd.exe for windows).

thumb_upUpvote34

smsComment

reportReport

Aanand Kara

, Game Runner, Sales Operations Management Experience

— Could some one explain me how to run a C program from a php script and store console output of the C program to a php variable? My program prints an integer ." 1 answer" ·" Top answer: " You'll want to use the shell_exec() function (quoting) : Execute command via shell and return the complete output as a string Which means something that ." run c program using php - Stack Overflow" 4 answers" 2 Feb 2013" How to call c functions from PHP? - Stack Overflow" 1 answer" 6 Nov 2016" How can i call function in a C program from php ." 1 answer" 23 May 2017" executing php script from C program and store the ." 3 answers" 26 Jun 2009" More results from stackoverflow.com

thumb_upUpvote5

smsComment

reportReport

Reyansh Sahota

, Title Examiner, Admissions

I too wrestled with getting a program to run in the background in Windows .

thumb_upUpvote5

smsComment

reportReport

Rajesh Dutta

, Special Forces Officers, Gaap Financial Performance Process Improvement Policies

Hello all. Let me put my problem in a simple way. I have written a C program, which i will keep in my server. Now i am developing a website using PHP, so that .

thumb_upUpvote0

smsComment

reportReport

Avyukt, Avyukta Konda

, Coatroom and Dressing Room Attendants, Regulatory Psychology

2:45" in this video i will show you how to run a C program (example: hello.c) from php using shell_exec() .when it ." · Uploaded by Ambar Hasbiyatmoko

thumb_upUpvote0

smsComment

reportReport