I've got a standard Magento 1.8.0.0 installation on Windows 7 using the BitNami Magento installation for XAMPP.

When I open the Sales -> Invoices screen and click on an invoice and then click on the orange Print button in the upper right hand corner of the screen I get the following error message inside the web browser:

Fatal error: Declaration of Zend_Pdf_FileParserDataSource_File::__construct() must be compatible with Zend_Pdf_FileParserDataSource::__construct() in C:\xampp\apps\magento\htdocs\lib\Zend\Pdf\FileParserDataSource\File.php on line 41

Anyone know why I am getting this and how to fix this?

up vote 16 down vote accepted

Magento in versions before CE 1.9 / EE 1.14 is not compatible with PHP 5.4 out of the box, which causes this error.

Anyways, there is an official patch for this.

This an incompatibility issue between PHP Version 5.4.4 and zend Framwork .

Fixed it by change in this function lib/Zend/Pdf/FileParserDataSource.php.

change

abstract public function __construct();

to

abstract public function __construct($filePath);

protected by Community Dec 21 '14 at 17:31

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.