Besides all the descriptions from PHP manual, let us do a small test. Create a file called test.php:
Create another file called runexec.php:
Create a runsystem.php:
All three files are located in the same directory. I found runexec.php cannot call test.php properly. I must use full path in the exec command. However, runsystem.php can work very well.