Hi,
I am currently using PHP on windows. I use a wamp server(Easy PHP) and codeblocks.
I already set the path from environment variable to compile a c file on cmd.
I use this command
gcc test.c -O3 -o test.exe
It can produce the test.exe
Now I want to execute it from a php file. I want the user to be able to compile their c file from a submit button.
print('<form action="compiler.php" method="POST"><input type="submit" value="Compile" ></form>');
Inside the compiler.php
[php]
[/php]
The result is an empty screen and no exe file produced in the ‘upload’ folder.
I already try
changing the $output variable to
$output = system('C:\Program Files\CodeBlocks\MinGW\bin\gcc.exe C:\Program Files\EasyPHP-5.3.9\www\upload\test.c -O3 -o C:\Program Files\EasyPHP-5.3.9\www\upload\test.exe");
and
$output = system("C:/Program Files/CodeBlocks/MinGW/bin/gcc.exe C:/Program Files/EasyPHP-5.3.9/www/upload/test.c -O3 -o C:/Program Files/EasyPHP-5.3.9/www/upload/test.exe");
But there is no result.
What am I missing?