Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    Try specifying full paths to your hello.c and a. Commented Jul 1, 2013 at 9:04
  • Also depends if you have privileges to use gcc from your user is it your server or a web hosting ? Commented Jul 1, 2013 at 9:07
  • @AleksG: I tried with exec('gcc -o /opt/lampp/htdocs/a /opt/lampp/htdocs/hello.c'); but no chage! Commented Jul 1, 2013 at 9:10
  • Get information in error log file. You might have permission restrictions. Commented Jul 1, 2013 at 9:10
  • No errors? Of course: you are ignoring exec()'s optional arguments and return value, where errors would normally be reported. You're also discarding stderr. Commented Jul 1, 2013 at 9:11