Submission download unserialize() error at DAO.inc.php:350

Hi all,
after clicking on a submission file (DOC or DOCX) nothing happens and the following log line can be seen in error.log:
NOTICE: unserialize(): Error at offset 6955 of 7005 bytes (/var/www/ojs/lib/pkp/classes/db/DAO.inc.php:350)
It should be noted that only some of the articles have this problem and others are OK. we were using 2.4.2 when this error occurred. After updating to 2.4.6 it still exists.
Looking forward for your help and advice. Thanks in advance.

Hi @mtoreihi,

Has your server recently changed its PHP version? I suspect there’s been a change there, and the old and new versions don’t have entirely compatible serialization formats.

Regards,
Alec Smecher
Public Knowledge Project Team

Yes, that is correct. The version of PHP has been changed. So, how should someone handle such a situation?

Hi all,

Chances are good that this is a character set problem, rather than a change in PHP’s serialization format. Double-check to ensure that your database character set and connection parameters (in config.inc.php) are the same as your old installation.

Regards,
Alec Smecher
Public Knowledge Project Team

Parameters are the same. Anyway, thanks for your suggestions.

Hi @mtoreihi,

One way to check whether the encoding has inadvertently changed (this can also happen during mysqldump/mysql transfer, on some versions I’ve needed to specify --default-character-set=utf8 when dumping the data) is by checking string lengths. On your old system (that’s working), try to identify a setting that’s causing you trouble and run something like…

 SELECT LENGTH(setting_value) FROM journal_settings WHERE setting_type='object';

Try the same query on your new server and ensure that the lengths are the same. If they’re slightly different, it’s likely that the encodings of accented characters have inadvertently changed. (If you have a lot of data, you might need to add WHERE setting_name = 'xyz' to the query.)

Regards,
Alec Smecher
Public Knowledge Project Team

Many thanks for your recommendation, Alec.