Skip to content
Advertisement

Warning: proc_open(): Unable to create temporary file

I am working on a local server and getting two warnings:

Warning: proc_open(): Unable to create temporary file. in C:xampphtdocs *** on line 159

and

Warning: proc_open(): cannot represent a stream of type TEMP as a File Descriptor in C:xampphtdocs *** on line 159

My code is:

$err_stream = fopen('php://temp','rw');
$stdout = fopen('php://stdout','w');
$process = proc_open(self::PHP_8_0_COMMAND,[
   0 => array("pipe", "r"),
   1 => $stdout,
   2 => $err_stream
], $pipes);

I’ve searched for the solution but I found nothing. I tried to change

$err_stream = fopen('php://temp','rw');

to

$err_stream = fopen('php://memory','rw');

but then I’m still getting the second warning.

Advertisement

Answer

Ok, I found out the answer.

The temporary directory was actually full and I just had to delete most of the files stored there.

I’ll try to implement a function deleting old temporary files.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement