Executing php inside php example

(Last Updated On: [post_updated])

1. Create a index.php,

<?php
echo "welcome to javadomain.in";
?>

2. Create a ExecPHP.php,

<?php
echo exec("D:\\xampp\\php\\php.exe D:\\xampp\\htdocs\\index.php");
?>

Note:
D:\\xampp\\php\\php.exe is the location of the php in the tested machine.If you have set the environment path, then you can run directly,
echo exec(“php.exe D:\\xampp\\htdocs\\index.php”);

Recommended Books:

207 total views, 0 views today

Leave a Reply

Your email address will not be published. Required fields are marked *