Hast du die Backslash vergessen oder hat die das Forum hier rausgelöscht?
Es müsste "use PhpOffice\PhpSpreadsheet\IOFactory;" lauten.
Es müsste "use PhpOffice\PhpSpreadsheet\IOFactory;" lauten.
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Class "PhpOffice\\PhpSpreadsheet\\IOFactory" not found in /var/www/vhosts/..../test_ex.php:5\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/.../test_ex.php on line 5'
$spreadsheet = IOFactory::load(__DIR__ . '/test.xls');
require __DIR__ . '/vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory;
$spreadsheet = IOFactory::load(__DIR__ . 'test.xls');
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
print_r($sheetData);
var_dump(
file_exists(__DIR__ . '/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php'),
file_exists(__DIR__ . '/vendor/phpoffice/phpspreadsheet/composer.json'),
is_readable(__DIR__ . '/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php'),
is_readable(__DIR__ . '/vendor/phpoffice/phpspreadsheet/composer.json')
);
Kommentar