PHPExcelで、エクセル保存時に、
Warning: ZipArchive::close(): Failure to create temporary file: Permission denied
とエラーが出ます。
パーミッションを777にしてもダメ。
わからなくなったので、テスト用のphpファイルを作成し、直接実行してみました。
<?php
require_once("/var/www/html/ ~/ lib/PHPExcel.php");
require_once("/var/www/html/ ~ /lib/PHPExcel/IOFactory.php");
$book = new PHPExcel();
$sheet = $book->getActiveSheet();
$sheet->setCellValue('A1', 10000);
$sheet->setCellValue('A2', true);
$sheet->setCellValue('A3', 'テスト');
$column = 1;
$sheet->setCellValueByColumnAndRow($column, 1, 'B1');
$sheet->setCellValueByColumnAndRow($column, 2, 'B2');
$sheet->setCellValueByColumnAndRow($column, 3, 'B3');
$writer = PHPExcel_IOFactory::createWriter($book, 'Excel2007');
$writer->save('out_excel/myTestxlsx');
?>
!!!問題なく実行されます。
・・・・・アパッチから実行できない。
・・・・・SELinux を確認。
geteoforce enforcing
家の環境ではSELinux を有効にしたいるのでした。忘れていました。
seteonforce permissive で無事にエクセルが出力されるようになりました。