I've spent enough time on this now that it's become personal.
I can't seem to figure out how to run a _PHP_ script from PHP. I'm on shared hosting.
I can run arbitrary commands from a php file. ps? sure. whoami? ls? which? Yes to all, and those are almost invasive.
But... I can't run a php file that echoes "Hi"... _from_ a php file. I can run any of this from a file hit by the server.
The php mailing list has a cron job (which is what I eventually want) that has php -q. I've tried all permutations I could think of based on that, as well as much time googling. I know I'm doing something wrong, but I can't figure out _what_.
I want to do two things:
1. Call a php file from a php file, with shell_exec or equiv
and
2. Call a php file from cron.
What is the proper syntax? Neither php -q /full/path/to/myfile or just adding !#/usr/bin/php -q to the top and /full/path/to/myfile work. I don't seem to have any useful error messages. Anyone conquer a problem like this?
I can't seem to figure out how to run a _PHP_ script from PHP. I'm on shared hosting.
I can run arbitrary commands from a php file. ps? sure. whoami? ls? which? Yes to all, and those are almost invasive.
But... I can't run a php file that echoes "Hi"... _from_ a php file. I can run any of this from a file hit by the server.
The php mailing list has a cron job (which is what I eventually want) that has php -q. I've tried all permutations I could think of based on that, as well as much time googling. I know I'm doing something wrong, but I can't figure out _what_.
I want to do two things:
1. Call a php file from a php file, with shell_exec or equiv
and
2. Call a php file from cron.
What is the proper syntax? Neither php -q /full/path/to/myfile or just adding !#/usr/bin/php -q to the top and /full/path/to/myfile work. I don't seem to have any useful error messages. Anyone conquer a problem like this?