How to include a PHP Framework / Library in my module? I wanted to include PHPExcel.php in a testing module. So I put this file and the rest of the lib into:
sites/all/libraries/phpexcel/
and I used this in my module:

function mymod_libraries_info() {

$libraries['phpexcel'] = array(
'name' =&gt; 'PHP Excel',
'version arguments' =&gt; array(
  'file' =&gt; 'PHPExcel.php', // Could be any file with version info 
  'pattern' =&gt; '/Version (\d+)/', 
  'lines' =&gt; 5,
),
'files' =&gt; array(
  'php' =&gt; array('PHPExcel.php'), 
),
);
return $libraries;
}


But after a:

$objPHPExcel = new PHPExcel();


I get a:


  Fatal error: Class 'PHPExcel' not found in sites/all/modules/mymod/mymod.module on line 81


Should be an easy inclusion somewhere? But where and how?

I found a composer.json as well along with the PHPExcel Lib - should I rather try to install composer_manager and try to get the composer installation working?

Thanks in advance
Your file path is maybe incorrect. Try the code below:

function mymod_libraries_info() {

    global $base_url;
    $path = $base_url . '/sites/all/libraries/phpexcel/PHPExcel.php';

    $libraries['phpexcel'] = array(
        'name' =&gt; 'PHP Excel',
        'version arguments' =&gt; array(
            'file' =&gt; $path, 
            'pattern' =&gt; '/Version (\d+)/', 
            'lines' =&gt; 5,
        ),
    'files' =&gt; array(
       'php' =&gt; array('PHPExcel.php'), 
    ),
);
return $libraries;
}