I want to run a PHP cli program from within PHP cli. On some machines where this will run, both php4 and php5 are installed. If I run the outer program as
The SHELL environment variable on Unix has the path to the shell that's currently running. If you add #!/path/to/php to the top of your PHP file, make it executable and run the file directly, does $_ENV['SHELL'] contain /path/to/php?