Open files with lock (especially open sessions) should be closed before executing a program in the background.
These functions are also closely related to the backtick operator. Also, while in безопасный режим you must consider the safe_mode_exec_dir directive.