PHP Warning: proc_open(): CreateProcess failed, error code - 267
Asked Answered
D

1

6

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.

Demimondaine answered 18/5, 2015 at 6:17 Comment(0)
D
8

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).

Demimondaine answered 18/5, 2015 at 6:17 Comment(2)
I tried to use VersionPress wordpress plugin, and it says the same thing. I am in Windows 10 at the moment. How can I resolve this issue on Windows Machine, please?Pucida
@AlexisRichard Are you talking about github.com/versionpress/versionpress ? It may be that you don't have write-access to the tmp directory. You could try setting the VP_VPDB_DIR environment variable, but I'm not really sure. You'd be best off asking the VersionPress developers, and supplying a proper error report.Demimondaine

© 2022 - 2024 — McMap. All rights reserved.