Hi,
I am writing a PHP script that upload a file that execute other c files by using system calls fork(), and exec(), and execl().
Unfortunately exec() and execl() functions did not work.
In more details, the PHP script , execute exec() function to execute p1 which is the executable file of p1.c, and the p1.c program calls execl("./p2", "./p2", "[login to view URL]","[login to view URL]", NULL); to execute p2 which is the executable file of p2.c. As the result shows in screenshot file of the output; execl() function did not execute and have the following out
Process 1 is running.
Process 1 is forking a new child process.
Process 1 is running.
Process 1 is forking a new child process.
The child of Process 1 is running.
The child of Process 1 is replacing itself.
YOU'LL NEVER EVER SEE THIS LINE :(
It should have the following output:
Process 1 is running.
Process 1 is forking a new child process.
Process 1 is running.
Process 1 is forking a new child process.
The child of Process 1 is running.
The child of Process 1 is replacing itself.
Process 2 is running
Process 2 is expecting 2 arguments
Process 2 receives 2 arguments
I got this
And I got this
Process 2 is done. Goodbye!!
That means this printf("YOU'LL NEVER EVER SEE THIS LINE :( \n"); will never execute if the execl() is working at p1.c program.
To see the whole project how it works, please follow the follwing steps:
1- put all folder in some directory in your computer.
2- click on this URL : http://localhost/enc/
3- Upload p1 file from app folder
4- click on upload button to see the result.
5- look at PHP script, and P1.c, P2.c for more details.
Please check the attached files and send me privatge message if any query.
I am expecting bids only from the serious bidders.
Deadline: 1 day.
Payment after successful completion of the project and delivery.
Cheers!