Problem getting dompdf to work

Hi All,

I seem to be running in circles. And I’m getting dizzy so I hope you fine people can help me!

For my application I am trying to implement dompdf. I have uploaded it into my proteced/extensions directory and set the permissions.

I import the extension via




Yii::import('ext.dompdf.*');


and get the base php file with 


require_once("myapplication/protected/extensions/dompdf/dompdf_config.inc.php");



Now I want to set an object using




$myFinePDFObject = new DOMPDF();



The import and require seem to go without problems but I get no object. I don’t see an error message in my php_errors and my debug statements run dry after setting the object.

Any ideas? It must be something simple but I cannot find it. Any help would be much appreciated!

  • xajaccio

It seems to me a problem with the auto loader conflict.

http://www.yiiframework.com/wiki/101/how-to-use-phpexcel-external-library-with-yii

The wiki is for PHPExcel, but I guess it’s also applicable to dompdf.

Would you please try this?




// unregister Yii's autoloader

spl_autoload_unregister(array('YiiBase', 'autoload'));

// register dompdf's autoloader

require_once("myapplication/protected/extensions/dompdf/dompdf_config.inc.php");

// register Yii's autoloader again

spl_autoload_register(array('YiiBase', 'autoload'));



softark, you are a life-saver! Thanks!!