PHPExcel import error while loading in IIS

I am using PHPExcel to read data from an XLSX file. Everything works correctly on Debian and Apache, but on IIS it does not work at boot time:

    $input = "C:/Inetpub/wwwroot/import/data/test.xlsx";
    $objReader = new PHPExcel_Reader_Excel2007();
    $objReader->setReadDataOnly(true);
    print "Starting...";
    try {
            $objPHPExcel = $objReader->load($input);
            print("Done!");
    } catch (Exception $e) {
            print "Caught exception: " . $e->getMessage();
    }

Unfortunately, after "Start ..." there are no additional results, although errors and tracking are not displayed in IIS logs. The path to the file is correct (checked by both / and /) and has the appropriate permissions. Also an exception does not occur (tkx @Mark).

Please inform:

1) Is there a way to enable some debugging to see exactly where PHPExcel stops and (maybe) why?

2) What do I need to change for this code to work on Windows and IIS.

+3
source share
3 answers

XDebug? IDE, Netbeans phpDesigner, .

, , , .

, , , . .

!

0

, zip php.ini:

extension=php_zip.dll

, .

0

, :

PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

PHPExcel: https://phpexcel.codeplex.com/wikipage?title=FAQ&referringTitle=Home

PHP , ZipArchive

Be sure to follow all the requirements, especially the php_zip extension must be enabled. The ZipArchive class is only required when reading or writing formats that use Zip compression (Excel2007 and OOCalc). From version 1.7.6, the PCLZip library was bundled with PHPExcel as an alternative to the ZipArchive class. This may include a call:

PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

before calling the save method in Excel2007 Writer. You can return to using ZipArchive by calling:

PHPExcel_Settings::setZipClass(PHPExcel_Settings::ZIPARCHIVE);

Currently, this allows you to write Excel2007 files without the need for ZipArchive (do not read Excel2007 or OOCal)

0
source

All Articles