1

Hello i am using phpexcel reader to read xlsx content on my server IE go-daddy. I tried the very attached code locally and its working very fine. But on server its showing blank output with no errors.

set_include_path(get_include_path() . PATH_SEPARATOR . 'Classes/');
require 'PHPExcel/IOFactory.php';
$inputFileName = "1479736652Students_Add.xlsx";
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
print_r($sheetData);
for($i=2;$i<=count($sheetData);$i++){           
    $name = $sheetData[$i]["A"];
    $email = strtolower($sheetData[$i]["B"]);
    $phone = $sheetData[$i]["C"];
    $class = $sheetData[$i]["D"];
}

I have googled a lot and am confused why such thing is happening. Any help is deeply appreciated.Thank you in advance.

santoshu
  • 51
  • 6

2 Answers2

0

Not really an answer, but rather things to try:

Enable PHP error reporting on that page and see if you get more of a response than a blank page:

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

Also check the permissions and location of this file:

$inputFileName = "1479736652Students_Add.xlsx";

As maybe the remote server has different permissions than your localhost and it may be expecting a different path as well.

lthrhx
  • 90
  • 1
  • 9
0

Researched phpexcel libraries on basis of rror class 'ziparchive' not found in phpexcel and found that we need to include PCLZip in the PHPExcel distribution as an alternative to PHP's built-in ZipArchive class.

You can include it by adding this

PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
santoshu
  • 51
  • 6