I developed a website using php and mysql where users have to upload excel files. In local server (XAMPP) I downloaded phpspreadsheet and was able to upload excel file to mysql database. But when I am working on the same thing on IIS (Windows server 2012 r2), the excel file cannot be uploaded to mysql and the basic code below is not working on IIS (Windows server 2012 r2) and shows
This page is not working properly. 10.10.10.2 is currently unable to process this request. HTTP error 500
In IIS Windows Server 2012 R2, I am using php 7.4.13. The code below works on XAMPP SERVER but not 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 you follow these steps
Please check out the following articleHow to install Windows with IIS It's helpful and will guide you with attached step by step images