Fix Corrupted PHP Serialization Data

人氣點閱:3130
發表人
Fix Corrupted PHP Serialization Data 2012-10-17 16:50
/ / /

Fix Corrupted PHP Serialized Data

代碼:

PHP Notice:  unserialize(): Error at offset 8201 of 44790 bytes in /tmp/photos_dat_parse.php on line 4


It is so miserable if you found your old PHP modules serialized data corrupted and there is __NO__ backup file existed.
e.g. "Menalto Gallery" version-1/2 PHOTOS.DAT or ALBUMS.DAT corrupted, yet none sane backup serialized file remained.

The following tools may __SOMETIMES__ help to repair the broken serialized data, but remember NOT-always.

1. http://www.thecodify.com/php/repair-a-serialized-array/

2. http://shauninman.com/archive/2008/01/08/recovering_truncated_php_serialized_arrays

3. http://stackoverflow.com/questions/3148712/regex-code-to-fix-corrupt-serialized-php-data

4. http://stackoverflow.com/questions/8113542/making-a-script-that-can-recover-a-corrupt-serialized-string-in-php




No matter you can fix it or not,
TRY __not__ to store data in serialized format
as possible as you can, especially when the data will be with R+W transactions because it is usually hard to fix even manually by human-parser.




_
________________

美術插畫設計案子報價系統 v0.1 Beta
爪哇禾雀