Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

PHPでexcel出力メモ PhpSpreadsheetが使えない場合……

More than 1 year has passed since last update.

何かPhpSpreadsheetがおすすめらしいが
https://qiita.com/suin/items/7a8d0979b7675d6fd05b
composerが現在インストール出来ていないので
他の方法としてやってみた事をメモらせて頂きます。

https://qiita.com/ao_love/items/33f4509654d3a19fe53e
記載の
ここからダウンロード
(2015.6.10時点での最新は1.8.0です)

処理に必要なのはClassesフォルダだけなので、解凍した後にClassesだけ処理を行うPHP付近に置けばOK
との事なのでやってみたのですが
```php
//ディレクトリ設定
$dir = './';//ここ

//ライブラリ読み込み
require_once $dir . '/Classes/PHPExcel.php';
require_once $dir . '/Classes/PHPExcel/IOFactory.php';

//テンプレート読み込み
//$file =$dir.'temp.xls';//テンプレート名
$file =$dir.'temp.xlsx';//テンプレート名
$reader = PHPExcel_IOFactory::createReader('Excel5');
```

Fatal error: Uncaught exception 'Exception' with message 'The filename ./temp.xlsx is not recognised as an OLE file' in /data/web/www/contents/Classes/PHPExcel/Shared/OLERead.php:87 Stack trace: #0 /data/web/www/contents/ma2/Classes/PHPExcel/Reader/Excel5.php(1183): PHPExcel_Shared_OLERead->read('./temp.xlsx') #1 /data/web/www/contents/ma2/Classes/PHPExcel/Reader/Excel5.php(689): PHPExcel_Reader_Excel5->_loadOLE('./temp.xlsx') #2 /data/web/www/contents/ma2/exportExcel.php(20): PHPExcel_Reader_Excel5->load('./temp.xlsx') #3 {main} thrown in /data/web/www/contents/ma2/Classes/PHPExcel/Shared/OLERead.php on line 87

だった……なぜーーーー

moitaro
気になったため登録いたします。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away