Exporting to Excel in PHP with error

0

I have a problem when trying to export file to Excel in PHP. I tried with the PHPExcel library even though it was deprecated / deprecated and tested with PhpSpreadSheet as well. But both presented the same error and only in PHP 7.1.20 .

Error presented:

  

"excel can not open the file because the format or extension of   file is not valid "

When opened with some text editor, it displays this message:

  

Fatal error : Uncaught PhpOffice \ PhpSpreadsheet \ Writer \ Exception: Could not open php: // output for writing. in C: \ DESENV \ DefaultCollection \ STCPWebAdmin \ Site \ www \ cgi-bin \ libs \ vendor \ phpoffice \ phpspreadsheet \ src \ PhpSpreadsheet \ Writer \ Xlsx.php: 218   Stack trace:   < # 0 C: \ DESENV \ DefaultCollection \ STCPWebAdmin \ Site \ www \ stcpwebversionxls.php (104): PhpOffice \ PhpSpreadsheet \ Writer \ Xlsx-> save ('php: // output')   
< # 1 {main}     thrown in C: \ DESENV \ DefaultCollection \ STCPWebAdmin \ Site \ www \ cgi-bin \ libs \ vendor \ phpoffice \ phpspreadsheet \ src \ PhpSpreadsheet \ Writer \ Xlsx.php / b>

I tested in versions 7.1.14 and 7.1.17 and it worked normally .

Do you know why?

    
asked by anonymous 14.08.2018 / 23:09

1 answer

0

I think the problem was in the PHP download, it probably must have corrupted some files when downloading. Because I downloaded PHP 7.1.20 again, I pointed to the new folder and it is now working.

    
16.08.2018 / 19:07