0

I installed phpspreadsheet on my subdirectory banana(OMG.com/fruits/banana). And tried to open its sample page.(banana/vendor/phpoffice/phpspreadsheet/samples/index.php) But it didn't work. So I followed source, and changed css and js path on Header.php like this.

From  <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css"/>
To    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>

Then the sample page (samples/index.php) shows correctly. So I clicked its sample menu. But it didn't work again. Error code was 404. I opened sample/index.php and observed sample menu link. The link was this.

OMG.com/Autofilter/10_Autofilter.php

But 10_Autofilter.php was not in there. it was in here.

OMG.com/fruits/banana/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter.php

I found the reason is path. But I didn't know how to solve. I thought the easiest way is install phpspreadsheet by composer on root directory. But I thought again and it's not gonna success. because if I install phpspreadsheet on root directory, the sample pages will be on here.

OMG.com/vendor/phpoffice/phpspreadsheet/samples/Autofilter/10_Autofilter.php

But the link was like this.

OMG.com/Autofilter/10_Autofilter.php

Maybe this can be easy fundamental problem. But I don't know how.

Help...

PS. I installed phpspreadsheet on here.

OMG.com/fruits/banana> composer require phpoffice/phpspreadsheet
baejusik
  • 71
  • 1
  • 8

1 Answers1

0

PHPSpreadsheet is a library, intended to be used by your programs, and not directly accessible through a web interface.... and the examples are written to be run from the command line (if you want to run them).

You need to create a script in your normal home directory that includes the vendor autoloader, and then the classes in PHPSpreadsheet will be accessible to your script

Mark Baker
  • 209,507
  • 32
  • 346
  • 385