this is an astonishing bad idea (doubly so since you're trying to use a really bad 'glue' layer that you *don't understand*)
I know you're likely not listening but it bears saying in case some other poor sap comes along and reads this thinking it's a good idea.
If you want to trigger something from php then start using some tool that decouples the 'trigger' from the event.
There are many solutions, including trivially a shared database that your rub script polls to look for new work and puts the results (if any) into. Better is to use a proper message queue of some form (since that's what you're basically re-implementing if you use the database).
I know you're likely not listening but it bears saying in case some other poor sap comes along and reads this thinking it's a good idea.
If you want to trigger something from php then start using some tool that decouples the 'trigger' from the event.
There are many solutions, including trivially a shared database that your rub script polls to look for new work and puts the results (if any) into. Better is to use a proper message queue of some form (since that's what you're basically re-implementing if you use the database).