I've searched high and low, but all the suggestions and tips I've found do not work for some reason. I have a batch file that is being invoked as such:
cmd /C "automateMyProgram.bat >> automation.log 2>>&1"
That works great: automation.log gets loaded with all the stdout and stderr for that particular batch file. However, within that batch script I have the following command:
start php updateDB.php param1 param2 ^> updateDB.log
The php script does get executed just fine and reads in the parameters just fine, but updateDB.log is never created. I ensured that php error reporting in the php.ini file is set to output errors to the command line interface. There are several echo statements within the php script that I need to have recorded to a log, but they are not being output for some reason. I read that if you use the start command to invoke a program, you must use the caret operator to redirect output since the program is started in a new process. I also tried:
start php updateDB.php param1 param2 >> updateDB.log
and that didn't work either. So I then tried:
start /B "Database Update" "php" "param1" "param2" >> updateDB.log
and that didn't work from within the batch file, but it did when I copy and pasted it directly into a cmd window on the desktop.
Might any of you know how I can redirect the output of the php script being called from a batch file?
Thanks for your time and help!