I have developed a website using php & mysql where the user have to upload a excel file. In local server (XAMPP), I have download phpspreadsheet and I am able to upload excel file to mysql database. But when I am working in same thing on IIS (Windows server 2012 r2), excel file not upload to mysql and below basic code not working on IIS (Windows server 2012 r2) and show
This page isn't working. 10.10.10.2 is currently unable to handle this request. HTTP ERROR 500
In IIS windows server 2012 r2, I am using php 7.4.13.Below code working on XAMPP SERVER but not working on IIS (Windows server 2012 R2)
<?php
require 'vendor/vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Style\Color;
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'This new hello World !');
$writer = new Xlsx($spreadsheet);
$writer->save('ThisMyExcelExample.xlsx');
?>
On Windows Server, there are more steps involved. make sure that you made the following steps
please check the following article How to Host PHP on windows with IIS its helpful & will guide you with attached images of steps
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.