Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I was trying to run a C program that takes input from a file and writes into a file, I have tried system, exec, shell_exec and those have not worked for me. Is there any other way to do this? Also, the C program requires multiple command line arguments.

This is the code that I used.

<?php

system('./gpmetis 1.graph 100', $outputArray);
print_r($outputArray);

?>

The error code I get is 139. It is not from my program, and from PHP. I tried looking it up on the net and found nothing useful.

share|improve this question
2  
If you don't show exactly what your tried, and explain precisely what "doesn't work" means, no-one can help you fix your code. – Mat 45 mins ago
<?php system('./gpmetis 1.graph 100', $outputArray); print_r($outputArray); ?> – user2602282 20 mins ago
You don't describe what "doesn't work" means. What's happening? What's not happening? What error(s) are you getting? – Mat 17 mins ago
And the error code is 139 – user2602282 15 mins ago
Put that in your question, not in the comments. And what is error code 139? Does it come from PHP or your program? If from PHP, did you look up what that error means? If from your program, what does it mean? – Mat 14 mins ago

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.