How to run php using the exec function with parameters?

All kind time of day!
I have a little problem: need to run a php function in background. (cron and other OS options do not roll)
The only option that I found on the Internet is run via exec, but I need to run the file itself, and only the function from a php file.. and even with parameters - how to do it?
July 8th 19 at 12:20
2 answers
July 8th 19 at 12:22
To pass parameters to php through the console(ssh)?

function hello($name)
 return 'hello' . $name;

function bye()
 return 'bye' . $name;

echo hello($argv[1]);

exec('php -f hello.php AlelxSSS'); // hello AlelxSSS
July 8th 19 at 12:24
Write your script myfile.php in which do:



And start your file: /usr/bin/php /www/myfile.php
The way to replace the actual.

Find more questions by tags PHP