How to execute a php script from another php script by using the shell?

Viewed 10976

I have a php file called sample.php with the following content:

<?php
echo "Hello World!";
?>

And what I want to do, is to run this php script using a second php script.

I think shell_exec could help me, but I don't know its syntax.

By the way, I want to execute this files with cpanel. So I have to execute the shell.

Is there any way to do this?

7 Answers
Related