php - PHPExcel is showing error on Remote Server -
i using phpexcel in php classes generate xls file. code working on localhost showing errors on remote server.
errors :
<br /> <b>warning</b>: include(inc/classes/phpexcel_shared_string.class.php): failed open stream: no such file or directory in <b>/home/example/../index.php</b> on line <b>13</b><br /> <br /> <b>warning</b>: include(): failed opening 'inc/classes/phpexcel_shared_string.class.php' inclusion (include_path='.:/usr/share/pear:/home/example/../inc/classes/classes/') in <b>/home/example/../index.php</b> on line <b>13</b><br />
i have been searching on internet , found solution update php version , enable php libraries updated on remote server. tell me can reason of these errors on remote server ?
i using index.php file in have default __autoloader() function load .class files , file named excelgenerate.php in again using same autoloader load class file. in file, have function in using phpexcel code generate excel file including phpexcel.php. flow in getting error.
the phpexcel file isn't
phpexcel_shared_string.class.php
it's
phpexcel/shared/string.php
it looks though may have autoloader that's clashing phpexcel autoloader: try using spl_autoload_register()
edit
quoting php docs (section 3.2 of developer documentation)
phpexcel implements autoloader or “lazy loader”, means not necessary include every file within phpexcel. necessary include initial phpexcel class file, autoloader include other class files , when required, files required script loaded php memory. main benefit of reduces memory footprint of phpexcel itself, uses less php memory.
if own scripts define autoload function, may overwritten phpexcel autoload function. example, if have:
function __autoload($class) { ... }
do instead:
function myautoload($class) { ... } spl_autoload_register('myautoload');
your autoloader co-exist autoloader of phpexcel.
Comments
Post a Comment