'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:\xampp\htdocs\ *** on line 159
and
Warning: proc_open(): cannot represent a stream of type TEMP as a File Descriptor in C:\xampp\htdocs\ *** 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.
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Lendzmianos |