MNB PHPExcelDeveloper Guide
v2.0.5
Getting started

Installation and Environment Check

Install the main package, configure XAMPP, and verify the runtime before writing code.

Updated

LevelBeginnerReading time8 minPackagemnb/mnb-phpexcel
MnbExcel::version()MnbExcel::environmentCheck()

What you will learn

  • Install the main package with Composer.
  • Enable the useful XAMPP extensions.
  • Verify autoloading and runtime capabilities.

Before you start

  • PHP 8.1 or newer.
  • Composer available from the terminal.
  • A writable PHP project directory.

Install the main package#

Install the main package used throughout this documentation. It includes the MnbExcel facade, native XLSX and XLS support, CSV, JSON, XML, ODS reading, database tools, large-file workflows, and application services.

Terminal
composer require mnb/mnb-phpexcel:^2.0

Configure XAMPP for development#

  1. Open php.ini

    In XAMPP Control Panel, select Config → PHP (php.ini).

  2. Enable recommended extensions

    Enable openssl, zip, xmlreader, mbstring, iconv, and the PDO driver used by your database.

  3. Restart Apache

    PHP configuration changes are loaded only after Apache restarts.

  4. Check the command-line PHP

    Make sure the terminal and Apache use the intended PHP installation.

Terminal
php -v
php -m

Verify Composer autoloading#

check-environment.php
<?php

declare(strict_types=1);

require __DIR__ . '/vendor/autoload.php';

use Mnb\PHPExcel\MnbExcel;

printf("MNB PHPExcel %s\n", MnbExcel::version());
print_r(MnbExcel::environmentCheck());
Example shape
MNB PHPExcel 2.0.5
Array
(
    [php] => ...
    [xlsx] => ...
)

Use a predictable project layout#

Recommended layout
my-project/
├── composer.json
├── vendor/
├── public/
│   └── index.php
├── storage/
│   ├── imports/
│   ├── exports/
│   ├── queue/
│   └── temporary/
└── src/

Keep uploaded and generated workbooks outside the public web root. Serve downloads through controlled PHP responses.