Executing php inside php example

Executing php inside php example

1. Create a index.php,

<?php
echo "welcome to ngdeveloper.com";
?>

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:

467 total views, 2 views today

Leave a Reply

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