1

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. Commented Aug 5, 2016 at 12:40
  • Sure Commented Aug 5, 2016 at 12:40
  • @Shyam Why would he use a cron job? Commented Aug 5, 2016 at 12:40
  • @Shrey just explain what's the objective, is getting the thing done complex way good? Commented Aug 5, 2016 at 12:44
  • @GoldunoSupport Without understanding the context, How did you decide for yourself that this is the complex way? Commented Aug 17, 2019 at 12:56

1 Answer 1

3

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);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.