Is there a way to execute a different php file without having to include it in the current executing php file? Can shell_exec help?
5
-
What do you want to achieve ? Please explain more in question.Alok Patel– Alok Patel2016-08-05 12:40:20 +00:00Commented Aug 5, 2016 at 12:40
-
SureBlue– Blue2016-08-05 12:40:29 +00:00Commented Aug 5, 2016 at 12:40
-
@Shyam Why would he use a cron job?Blue– Blue2016-08-05 12:40:51 +00:00Commented Aug 5, 2016 at 12:40
-
@Shrey just explain what's the objective, is getting the thing done complex way good?Golduno Support– Golduno Support2016-08-05 12:44:58 +00:00Commented Aug 5, 2016 at 12:44
-
@GoldunoSupport Without understanding the context, How did you decide for yourself that this is the complex way?Shreyansh Panchal– Shreyansh Panchal2019-08-17 12:56:24 +00:00Commented Aug 17, 2019 at 12:56
Add a comment
|
1 Answer
You could use the exec function: http://php.net/manual/en/function.exec.php
e.g.
exec ('php -f /path/to/file.php',$output,$return);