0

I see following entries in my log file:

    2013-08-28T17:45:09+00:00 ERR (3): Warning: include(DOMPDF.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory  in /home/site/site.com/lib/Varien/Autoload.php on line 93
    2013-08-28T17:45:09+00:00 ERR (3): Warning: include(DOMPDF.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory  in /home/site/site.com/lib/Varien/Autoload.php on line 93
    2013-08-28T17:45:09+00:00 ERR (3): Warning: include() [<a href='function.include'>function.include</a>]: Failed opening 'DOMPDF.php' for inclusion (include_path='/home/site/site.com/app/code/local:/home/site/site.com/app/code/community:/home/site/site.com/app/code/core:/home/site/site.com/lib:.:/usr/local/lib/php:/usr/local/php5/lib/pear')  in /home/site/site.com/lib/Varien/Autoload.php on line 93
    2013-08-28T17:45:09+00:00 ERR (3): Warning: include(Stylesheet.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory  in /home/site/site.com/lib/Varien/Autoload.php on line 93
    2013-08-28T17:45:09+00:00 ERR (3): Warning: include(Stylesheet.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory  in /home/site/site.com/lib/Varien/Autoload.php on line 93

What could be the reason that DOMPDF_autoload function is not executed? Thanks.

Damir Mitrovic
  • 618
  • 1
  • 5
  • 14

2 Answers2

1

The file DOMPDF.php is not part of any standard Magento installation. It appears you, or someone working on your system, has injected some custom code into your Magento system.

Somewhere in this custom code, there's a line that looks something like this

$objet = new DOMPDF;

Since this DOMPDF object hasn't been defined, PHP tries to run it through it's autoloader. The autoloader for Magento classes is "first" on the queue, and treats DOMPDF like is was a Magento class.

This means trying to include the file DOMPDF.php. Since this class isn't a Magento class, the autoloader fails. Magento's autoloader doesn't fail gracefully, and you get the errors you see.

You'll need to make sure you're including all the files in DOMPDF correctly. There's myriad ways to do this — I'd contact the developer who did the initial work, or the developer who built the extension, and have them document how they included this library.

Alana Storm
  • 164,128
  • 91
  • 395
  • 599
0

I solved this issue by editing /lib/dompdf6/include/autoload.inc.php. Content of this file is:

    function DOMPDF_autoload($class) {
      $filename = DOMPDF_INC_DIR . "/" . mb_strtolower($class) . ".cls.php";

      if ( is_file($filename) )
        require_once($filename);
    }
    spl_autoload_register('DOMPDF_autoload');

This blog post was very helpful. http://sim.plified.com/2010/11/17/make-dompdf-work-with-magento/

Please note that code runs on PHP Version 5.3.13.

Damir Mitrovic
  • 618
  • 1
  • 5
  • 14
  • Which version of dompdf? The full content of the current autoload.inc.php is much larger: https://github.com/dompdf/dompdf/blob/master/include/autoload.inc.php – BrianS Sep 03 '13 at 17:28