Q:

Why does this require "..path" is returning a fatal error (PHP)?

my question is simple but I have not found a form to solve it. I am trying to include a library located on the magento's module which I am developing.
$simple_excel_path = Mage::getBaseDir('code')."/local/Javi/libraries/SimpleExcelLibrary/src/SimpleExcel/SimpleExcel.php";
echo $simple_excel_path;
require $simple_excel_path;

This code returns the following error:
(echo) this route is correct.
/home/javiertxu/Documentos/webs/magentoabc/app/code/local/Javi/libraries/SimpleExcelLibrary/src/SimpleExcel/SimpleExcel.php
(error) but the require function is going to another site
Fatal error: require(): Failed opening required '/home/javiertxu/Documentos/webs/magentoabc/app/codelocal/Javi/libraries/SimpleExcelLibrary/src/SimpleExcel/SimpleExcel.php' (include_path='/home/javiertxu/Documentos/webs/magentoabc/app/code/local:/home/javiertxu/Documentos/webs/magentoabc/app/code/community:/home/javiertxu/Documentos/webs/magentoabc/app/code/core:/home/javiertxu/Documentos/webs/magentoabc/lib:.:/usr/share/php') in /home/javiertxu/Documentos/webs/magentoabc/app/design/adminhtml/default/default/template/massiveupdatingproducts/massiveupdatingproductsbackend.phtml on line 5
This is the directory:

What I should do?
Thanks

A:

Your module name is lowercase, you should change libraries for Libraries, following module naming convention in Magento
Magento adds every code pool folder as include path, so you don't need to pass the full path (although that shouldn't throw any error), it is enough starting path from your module main folder ('Javi')
Last thing, be sure the file has the right permissions to be readable by webserver user

