If you’re getting these sort of errors when trying to use DOMPDF in Zend Framework 1.9.x …
Warning: include(DOMPDF.php) [function.include]: failed to open stream: No such file or directory in /home/myusername/library/Zend/Loader.php on line 83 Warning: include(DOMPDF.php) [function.include]: failed to open stream: No such file or directory in /home/myusername/library/Zend/Loader.php on line 83 Warning: include() [function.include]: Failed opening 'DOMPDF.php' for inclusion (include_path='/home/myusername/application/models:/home/myusername/library:.:/usr/lib/php:/usr/local/lib/php') in /home/myusername/library/Zend/Loader.php on line 83
And you’ve already tried the solution which has been written about a gajillion times:
require_once('dompdf/dompdf_config.inc.php');
spl_autoload_register('DOMPDF_autoload');
$dompdf = new DOMPDF();
Then I suggest you use the Zend_Loader_Autoloader::pushAutoloader() function, it’s really simple to use in the case of DOMPDF,
First we get the autoloader instance, then we push a new autoloader onto the stack giving the callback function as the first parameter and the namespace as the second. In the case of dompdf there is no namespace so just set it to an empty string.
Like so:
require_once('dompdf/dompdf_config.inc.php');
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->pushAutoloader('DOMPDF_autoload', '');
Note that we have to include the dompdf config file so the autoloader knows about the dompdf autoload function.
Thanks a lot, you’re the man !
Thanks for your work !
DOMPDF works perfect now
Thanks a lot from France !