I have following code:
public function actionSearch()
{
$inputFileName = "C:/Apache2/htdocs/filePurchase/files/file.xlsx";
$objReader = new PHPExcel_Reader_Excel2007();
$objPHPExcel = $objReader->load($inputFileName);
}
When i run this action on browser, this message raised:
The connection was reset
The connection to the server was reset while the page was loading.
With following code is no problem:
$inputFileName = "C:/Apache2/htdocs/filePurchase/files/file.xlsx";
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
What's the problem?
Edit:
var_dump($objReader):
object(PHPExcel_Reader_Excel2007)[19]
private '_referenceHelper' =>
object(PHPExcel_ReferenceHelper)[21]
protected '_readDataOnly' => boolean false
protected '_includeCharts' => boolean false
protected '_loadSheetsOnly' => null
protected '_readFilter' =>
object(PHPExcel_Reader_DefaultReadFilter)[20]
protected '_fileHandle' => null
Apache log:
[Fri Sep 13 19:46:50 2013] [notice] Parent: child process exited with status 255 -- Restarting.
httpd.exe: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
[Fri Sep 13 19:46:51 2013] [notice] Apache/2.2.23 (Win32) PHP/5.3.3 configured -- resuming normal operations
[Fri Sep 13 19:46:51 2013] [notice] Server built: Aug 24 2012 11:45:16
[Fri Sep 13 19:46:51 2013] [notice] Parent: Created child process 1184
httpd.exe: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
httpd.exe: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
[Fri Sep 13 19:46:52 2013] [notice] Child 1184: Child process is running
[Fri Sep 13 19:46:52 2013] [notice] Child 1184: Acquired the start mutex.
[Fri Sep 13 19:46:52 2013] [notice] Child 1184: Starting 64 worker threads.
[Fri Sep 13 19:46:52 2013] [notice] Child 1184: Starting thread to listen on port 80.
[Fri Sep 13 19:46:52 2013] [notice] Child 1184: Starting thread to listen on port 80.
[Fri Sep 13 19:46:53 2013] [notice] Parent: child process exited with status 255 -- Restarting.
httpd.exe: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
[Fri Sep 13 19:46:54 2013] [notice] Apache/2.2.23 (Win32) PHP/5.3.3 configured -- resuming normal operations
[Fri Sep 13 19:46:54 2013] [notice] Server built: Aug 24 2012 11:45:16
[Fri Sep 13 19:46:54 2013] [notice] Parent: Created child process 4744
httpd.exe: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
httpd.exe: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
[Fri Sep 13 19:46:55 2013] [notice] Child 4744: Child process is running
[Fri Sep 13 19:46:55 2013] [notice] Child 4744: Acquired the start mutex.
[Fri Sep 13 19:46:55 2013] [notice] Child 4744: Starting 64 worker threads.
[Fri Sep 13 19:46:55 2013] [notice] Child 4744: Starting thread to listen on port 80.
[Fri Sep 13 19:46:55 2013] [notice] Child 4744: Starting thread to listen on port 80.
Edit 2:
In following code, var_dump($objPHPExcel);
result comes and goes like a flashback. but when add a exit;
after var_dump($objPHPExcel);
can be seen the result:
public function actionSearch()
{
$inputFileName = "C:/Apache2/htdocs/filePurchase/files/file.xlsx";
$objReader = new PHPExcel_Reader_Excel2007();
//var_dump($objReader);
$objPHPExcel = $objReader->load($inputFileName);
var_dump($objPHPExcel); exit;
}
var_dump($objPHPExcel);
result:
object(PHPExcel)[23]
private '_uniqueID' => string '5233fcc54c677' (length=13)
private '_properties' =>
object(PHPExcel_DocumentProperties)[39]
private '_creator' => string 'TMP' (length=3)
private '_lastModifiedBy' => string 'TMP' (length=3)
private '_created' => int 1378454286
private '_modified' => int 1379082907
private '_title' => string '' (length=0)
private '_description' => string '' (length=0)
private '_subject' => string '' (length=0)
private '_keywords' => string '' (length=0)
private '_category' => string '' (length=0)
private '_manager' => string '' (length=0)
private '_company' => string 'Microsoft Corporation' (length=21)
private '_customProperties' =>
array
empty
private '_security' =>
object(PHPExcel_DocumentSecurity)[40]
private '_lockRevision' => boolean false
private '_lockStructure' => boolean false
private '_lockWindows' => boolean false
private '_revisionsPassword' => string '' (length=0)
private '_workbookPassword' => string '' (length=0)
private '_workSheetCollection' =>
array
0 =>
object(PHPExcel_Worksheet)[293]
private '_parent' =>
&object(PHPExcel)[23]
private '_cellCollection' =>
object(PHPExcel_CachedObjectStorage_Memory)[292]
...
private '_rowDimensions' =>
array
...
private '_defaultRowDimension' =>
object(PHPExcel_Worksheet_RowDimension)[302]
...
private '_columnDimensions' =>
array
...
private '_defaultColumnDimension' =>
object(PHPExcel_Worksheet_ColumnDimension)[303]
...
private '_drawingCollection' =>
object(ArrayObject)[299]
...
private '_chartCollection' =>
object(ArrayObject)[300]
...
private '_title' => string 'Sheet1' (length=6)
private '_sheetState' => string 'visible' (length=7)
private '_pageSetup' =>
object(PHPExcel_Worksheet_PageSetup)[295]
...
private '_pageMargins' =>
object(PHPExcel_Worksheet_PageMargins)[296]
...
private '_headerFooter' =>
object(PHPExcel_Worksheet_HeaderFooter)[297]
...
private '_sheetView' =>
object(PHPExcel_Worksheet_SheetView)[298]
...
private '_protection' =>
object(PHPExcel_Worksheet_Protection)[301]
...
private '_styles' =>
array
...
private '_conditionalStylesCollection' =>
array
...
private '_cellCollectionIsSorted' => boolean false
private '_breaks' =>
array
...
private '_mergeCells' =>
array
...
private '_protectedCells' =>
array
...
private '_autoFilter' =>
object(PHPExcel_Worksheet_AutoFilter)[304]
...
private '_freezePane' => string '' (length=0)
private '_showGridlines' => boolean true
private '_printGridlines' => boolean false
private '_showRowColHeaders' => boolean true
private '_showSummaryBelow' => boolean true
private '_showSummaryRight' => boolean true
private '_comments' =>
array
...
private '_activeCell' => string 'B4' (length=2)
private '_selectedCells' => string 'B4' (length=2)
private '_cachedHighestColumn' => string 'E' (length=1)
private '_cachedHighestRow' => string '896' (length=3)
private '_rightToLeft' => boolean false
private '_hyperlinkCollection' =>
array
...
private '_dataValidationCollection' =>
array
...
private '_tabColor' => null
private '_dirty' => boolean true
private '_hash' => null
1 =>
object(PHPExcel_Worksheet)[291]
private '_parent' =>
&object(PHPExcel)[23]
private '_cellCollection' =>
object(PHPExcel_CachedObjectStorage_Memory)[3906]
...
private '_rowDimensions' =>
array
...
private '_defaultRowDimension' =>
object(PHPExcel_Worksheet_RowDimension)[3909]
...
private '_columnDimensions' =>
array
...
private '_defaultColumnDimension' =>
object(PHPExcel_Worksheet_ColumnDimension)[3910]
...
private '_drawingCollection' =>
object(ArrayObject)[1209]
...
private '_chartCollection' =>
object(ArrayObject)[3907]
...
private '_title' => string 'Sheet2' (length=6)
private '_sheetState' => string 'visible' (length=7)
private '_pageSetup' =>
object(PHPExcel_Worksheet_PageSetup)[1206]
...
private '_pageMargins' =>
object(PHPExcel_Worksheet_PageMargins)[1207]
...
private '_headerFooter' =>
object(PHPExcel_Worksheet_HeaderFooter)[318]
...
private '_sheetView' =>
object(PHPExcel_Worksheet_SheetView)[3904]
...
private '_protection' =>
object(PHPExcel_Worksheet_Protection)[3908]
...
private '_styles' =>
array
...
private '_conditionalStylesCollection' =>
array
...
private '_cellCollectionIsSorted' => boolean false
private '_breaks' =>
array
...
private '_mergeCells' =>
array
...
private '_protectedCells' =>
array
...
private '_autoFilter' =>
object(PHPExcel_Worksheet_AutoFilter)[3911]
...
private '_freezePane' => string '' (length=0)
private '_showGridlines' => boolean true
private '_printGridlines' => boolean false
private '_showRowColHeaders' => boolean true
private '_showSummaryBelow' => boolean true
private '_showSummaryRight' => boolean true
private '_comments' =>
array
...
private '_activeCell' => string 'A1' (length=2)
private '_selectedCells' => string 'A1' (length=2)
private '_cachedHighestColumn' => string 'A' (length=1)
private '_cachedHighestRow' => int 1
private '_rightToLeft' => boolean false
private '_hyperlinkCollection' =>
array
...
private '_dataValidationCollection' =>
array
...
private '_tabColor' => null
private '_dirty' => boolean true
private '_hash' => null
2 =>
object(PHPExcel_Worksheet)[3903]
private '_parent' =>
&object(PHPExcel)[23]
private '_cellCollection' =>
object(PHPExcel_CachedObjectStorage_Memory)[3913]
...
private '_rowDimensions' =>
array
...
private '_defaultRowDimension' =>
object(PHPExcel_Worksheet_RowDimension)[3921]
...
private '_columnDimensions' =>
array
...
private '_defaultColumnDimension' =>
object(PHPExcel_Worksheet_ColumnDimension)[3922]
...
private '_drawingCollection' =>
object(ArrayObject)[3918]
...
private '_chartCollection' =>
object(ArrayObject)[3919]
...
private '_title' => string 'Sheet3' (length=6)
private '_sheetState' => string 'visible' (length=7)
private '_pageSetup' =>
object(PHPExcel_Worksheet_PageSetup)[3915]
...
private '_pageMargins' =>
object(PHPExcel_Worksheet_PageMargins)[3916]
...
private '_headerFooter' =>
object(PHPExcel_Worksheet_HeaderFooter)[307]
...
private '_sheetView' =>
object(PHPExcel_Worksheet_SheetView)[3917]
...
private '_protection' =>
object(PHPExcel_Worksheet_Protection)[3920]
...
private '_styles' =>
array
...
private '_conditionalStylesCollection' =>
array
...
private '_cellCollectionIsSorted' => boolean false
private '_breaks' =>
array
...
private '_mergeCells' =>
array
...
private '_protectedCells' =>
array
...
private '_autoFilter' =>
object(PHPExcel_Worksheet_AutoFilter)[3923]
...
private '_freezePane' => string '' (length=0)
private '_showGridlines' => boolean true
private '_printGridlines' => boolean false
private '_showRowColHeaders' => boolean true
private '_showSummaryBelow' => boolean true
private '_showSummaryRight' => boolean true
private '_comments' =>
array
...
private '_activeCell' => string 'A1' (length=2)
private '_selectedCells' => string 'A1' (length=2)
private '_cachedHighestColumn' => string 'A' (length=1)
private '_cachedHighestRow' => int 1
private '_rightToLeft' => boolean false
private '_hyperlinkCollection' =>
array
...
private '_dataValidationCollection' =>
array
...
private '_tabColor' => null
private '_dirty' => boolean true
private '_hash' => null
private '_calculationEngine' =>
object(PHPExcel_Calculation)[24]
private '_workbook' =>
&object(PHPExcel)[23]
private '_calculationCache' =>
array
empty
private '_calculationCacheEnabled' => boolean true
private 'debugLog' => null
public 'suppressFormulaErrors' => boolean false
public 'formulaError' => null
private '_cyclicReferenceStack' =>
object(PHPExcel_CalcEngine_CyclicReferenceStack)[25]
private '_stack' =>
array
...
private '_cyclicFormulaCount' => int 0
private '_cyclicFormulaCell' => string '' (length=0)
public 'cyclicFormulaCount' => int 0
private '_savedPrecision' => string '14' (length=2)
public '_debugLog' =>
object(PHPExcel_CalcEngine_Logger)[26]
private '_writeDebugLog' => boolean false
private '_echoDebugLog' => boolean false
private '_debugLog' =>
array
...
private '_cellStack' =>
object(PHPExcel_CalcEngine_CyclicReferenceStack)[25]
...
private '_activeSheetIndex' => int 0
private '_namedRanges' =>
array
empty
private '_cellXfSupervisor' =>
object(PHPExcel_Style)[41]
protected '_font' =>
object(PHPExcel_Style_Font)[42]
protected '_name' => string 'Calibri' (length=7)
protected '_size' => int 11
protected '_bold' => boolean false
protected '_italic' => boolean false
protected '_superScript' => boolean false
protected '_subScript' => boolean false
protected '_underline' => string 'none' (length=4)
protected '_strikethrough' => boolean false
protected '_color' =>
object(PHPExcel_Style_Color)[43]
...
protected '_isSupervisor' => boolean true
protected '_parent' =>
&object(PHPExcel_Style)[41]
protected '_fill' =>
object(PHPExcel_Style_Fill)[44]
protected '_fillType' => string 'none' (length=4)
protected '_rotation' => int 0
protected '_startColor' =>
object(PHPExcel_Style_Color)[45]
...
protected '_endColor' =>
object(PHPExcel_Style_Color)[46]
...
protected '_isSupervisor' => boolean true
protected '_parent' =>
&object(PHPExcel_Style)[41]
protected '_borders' =>
object(PHPExcel_Style_Borders)[47]
protected '_left' =>
object(PHPExcel_Style_Border)[48]
...
protected '_right' =>
object(PHPExcel_Style_Border)[50]
...
protected '_top' =>
object(PHPExcel_Style_Border)[52]
...
protected '_bottom' =>
object(PHPExcel_Style_Border)[54]
...
protected '_diagonal' =>
object(PHPExcel_Style_Border)[56]
...
protected '_diagonalDirection' => int 0
protected '_allBorders' =>
object(PHPExcel_Style_Border)[58]
...
protected '_outline' =>
object(PHPExcel_Style_Border)[60]
...
protected '_inside' =>
object(PHPExcel_Style_Border)[62]
...
protected '_vertical' =>
object(PHPExcel_Style_Border)[64]
...
protected '_horizontal' =>
object(PHPExcel_Style_Border)[66]
...
protected '_isSupervisor' => boolean true
protected '_parent' =>
&object(PHPExcel_Style)[41]
protected '_alignment' =>
object(PHPExcel_Style_Alignment)[68]
protected '_horizontal' => string 'general' (length=7)
protected '_vertical' => string 'bottom' (length=6)
protected '_textRotation' => int 0
protected '_wrapText' => boolean false
protected '_shrinkToFit' => boolean false
protected '_indent' => int 0
protected '_isSupervisor' => boolean true
protected '_parent' =>
&object(PHPExcel_Style)[41]
protected '_numberFormat' =>
object(PHPExcel_Style_NumberFormat)[69]
protected '_formatCode' => string 'General' (length=7)
protected '_builtInFormatCode' => int 0
protected '_isSupervisor' => boolean true
protected '_parent' =>
&object(PHPExcel_Style)[41]
protected '_conditionalStyles' =>
array
empty
protected '_protection' =>
object(PHPExcel_Style_Protection)[70]
protected '_locked' => string 'inherit' (length=7)
protected '_hidden' => string 'inherit' (length=7)
protected '_isSupervisor' => boolean true
protected '_parent' =>
&object(PHPExcel_Style)[41]
protected '_index' => null
protected '_isSupervisor' => boolean true
protected '_parent' =>
&object(PHPExcel)[23]
private '_cellXfCollection' =>
array
0 =>
object(PHPExcel_Style)[117]
protected '_font' =>
object(PHPExcel_Style_Font)[118]
...
protected '_fill' =>
object(PHPExcel_Style_Fill)[120]
...
protected '_borders' =>
object(PHPExcel_Style_Borders)[123]
...
protected '_alignment' =>
object(PHPExcel_Style_Alignment)[134]
...
protected '_numberFormat' =>
object(PHPExcel_Style_NumberFormat)[135]
...
protected '_conditionalStyles' =>
array
...
protected '_protection' =>
object(PHPExcel_Style_Protection)[136]
...
protected '_index' => int 0
protected '_isSupervisor' => boolean false
protected '_parent' => null
1 =>
object(PHPExcel_Style)[143]
protected '_font' =>
object(PHPExcel_Style_Font)[144]
...
protected '_fill' =>
object(PHPExcel_Style_Fill)[146]
...
protected '_borders' =>
object(PHPExcel_Style_Borders)[149]
...
protected '_alignment' =>
object(PHPExcel_Style_Alignment)[160]
...
protected '_numberFormat' =>
object(PHPExcel_Style_NumberFormat)[161]
...
protected '_conditionalStyles' =>
array
...
protected '_protection' =>
object(PHPExcel_Style_Protection)[162]
...
protected '_index' => int 1
protected '_isSupervisor' => boolean false
protected '_parent' => null
2 =>
object(PHPExcel_Style)[170]
protected '_font' =>
object(PHPExcel_Style_Font)[171]
...
protected '_fill' =>
object(PHPExcel_Style_Fill)[173]
...
protected '_borders' =>
object(PHPExcel_Style_Borders)[176]
...
protected '_alignment' =>
object(PHPExcel_Style_Alignment)[187]
...
protected '_numberFormat' =>
object(PHPExcel_Style_NumberFormat)[188]
...
protected '_conditionalStyles' =>
array
...
protected '_protection' =>
object(PHPExcel_Style_Protection)[189]
...
protected '_index' => int 2
protected '_isSupervisor' => boolean false
protected '_parent' => null
3 =>
object(PHPExcel_Style)[197]
protected '_font' =>
object(PHPExcel_Style_Font)[198]
...
protected '_fill' =>
object(PHPExcel_Style_Fill)[200]
...
protected '_borders' =>
object(PHPExcel_Style_Borders)[203]
...
protected '_alignment' =>
object(PHPExcel_Style_Alignment)[214]
...
protected '_numberFormat' =>
object(PHPExcel_Style_NumberFormat)[215]
...
protected '_conditionalStyles' =>
array
...
protected '_protection' =>
object(PHPExcel_Style_Protection)[216]
...
protected '_index' => int 3
protected '_isSupervisor' => boolean false
protected '_parent' => null
4 =>
object(PHPExcel_Style)[224]
protected '_font' =>
object(PHPExcel_Style_Font)[225]
...
protected '_fill' =>
object(PHPExcel_Style_Fill)[227]
...
protected '_borders' =>
object(PHPExcel_Style_Borders)[230]
...
protected '_alignment' =>
object(PHPExcel_Style_Alignment)[241]
...
protected '_numberFormat' =>
object(PHPExcel_Style_NumberFormat)[242]
...
protected '_conditionalStyles' =>
array
...
protected '_protection' =>
object(PHPExcel_Style_Protection)[243]
...
protected '_index' => int 4
protected '_isSupervisor' => boolean false
protected '_parent' => null
private '_cellStyleXfCollection' =>
array
0 =>
object(PHPExcel_Style)[250]
protected '_font' =>
object(PHPExcel_Style_Font)[251]
...
protected '_fill' =>
object(PHPExcel_Style_Fill)[253]
...
protected '_borders' =>
object(PHPExcel_Style_Borders)[256]
...
protected '_alignment' =>
object(PHPExcel_Style_Alignment)[267]
...
protected '_numberFormat' =>
object(PHPExcel_Style_NumberFormat)[268]
...
protected '_conditionalStyles' =>
array
...
protected '_protection' =>
object(PHPExcel_Style_Protection)[269]
...
protected '_index' => int 0
protected '_isSupervisor' => boolean false
protected '_parent' => null