I put phpexcel to /silex/vendor/
index.php:
<?php
require_once __DIR__.'/../vendor/autoload.php';
$app = new Silex\Application();
$app->register(new Silex\Provider\PHPExel());
$app->get('/hello', function() {
$objPHPExcel = \PHPExcel::newInstance();
$objPHPExcel = $objReader->load('123.xls');
return 'Hello!';
});
$app->run();
Fatal error: Class 'Silex\Provider\PHPExel' not found
you can install PHPexcel via composer, see https://github.com/ddeboer/phpexcel.
To use PHPExcel via composer simply create a new instance in your code: