I am going to generate a csv file to php output, so the user can download it immediately:
header( 'Content-Type: text/csv' );
header( 'Content-Disposition: attachment; filename=' . $filename );
$fp = fopen('php://ouput', 'w'); // Here is where error happens, line 156
if(!$fp) var_dump($fp); // output: bool(false)
but it produces the below errors:
Warning: fopen(): Invalid php:// URL specified in /home/mustafa/xxx/includes/functions.php on line 156
Warning: fopen(php://ouput): failed to open stream: operation failed in /home/mustafa/xxx/includes/functions.php on line 156
Why php://output is not valid
change this
to