I just spent a few hours pulling my hair out over this. I'm trying to get gcc to compile a file from within PHP.
$command = "/usr/bin/gcc /var/www/progpad/temp/tNu7rq.c -o /var/www/progpad/temp/tNu7rq.out";
exec($command, $output, $returnVal);
echo $returnVal."<br />"; //returns 1 and no output file created.
I'm running this on my own ubuntu server and both
/var/www/progpad/
/var/www/progpad/temp/
have chmod 777 set. If I copy and paste the command string, and paste it into the terminal it works perfectly.
Also if I replace the command string with something like
$command = "echo test > test.txt";
Then this has no problem creating the text file. What could I possibly be doing wrong here???