I am trying to include PHPExcel to a Silverstripe 3 site to export excel sheets. Right now I am just trying to test, but I get this error when trying to do it:
[Warning] require_once(/sitename/mysite/AddOns/PHPExcel/Classes/PHPExcel.php): failed to open stream: No such file or directory
As pointed out
Director::baseURL() will return the URL rather than the filepath.
Instead require relative from the file like so:
require_once(dirname(__FILE__) . '/../../AddOns/PHPExcel/Classes/PHPExcel.php');
Be sure to modify to represent your file structure.