A proc_open call like the following is failing with the above error.
<?php
$proc = proc_open($cmd, $ds, $pipes, '/tmp', array());
The command $cmd
works correctly when executed directly.
The problem has nothing to do with the actual command being executed.
Error code 267 is ERROR_DIRECTORY "The directory name is invalid." and in this case simply means that the /tmp
directory doesn't exist on the drive that the code is being run from.
Instead of /tmp
, use sys_get_temp_dir()
(which one can assume will always exist).