Switched to using proc_open instead of exec