ID: 39170 User updated by: cory dot nemelka at nemelkaitgroup dot com Reported By: cory dot nemelka at nemelkaitgroup dot com Status: Open Bug Type: dBase related Operating System: RHEL 3.0 PHP Version: 5.1.6 New Comment:
previous version that could read these files was PHP v5.0.4, not v5.0.3. Previous Comments: ------------------------------------------------------------------------ [2006-10-17 04:15:12] cory dot nemelka at nemelkaitgroup dot com Also, to clarify, the dbase_open function works fine with non-Visual Foxpro .dbf files. If you'd like, I'll dig into this further by downloading the C code for the dbase functions. lmk, --cnemelka ------------------------------------------------------------------------ [2006-10-17 04:11:29] cory dot nemelka at nemelkaitgroup dot com You can download a small .dbf file at the following url that should not open: http://tinyurl.com/yce3bn NOTE: The .dbf files that won't open will also not open in Excel or Access (they should). However, PHP v5.0.3? was able to open these files ok. ------------------------------------------------------------------------ [2006-10-17 04:08:54] cory dot nemelka at nemelkaitgroup dot com <?php $dbh=dbase_open("o1.dbf", 0); $ci = dbase_get_header_info($dbh); print_r($ci); ?> ------------------------------------------------------------------------ [2006-10-16 20:24:06] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2006-10-16 20:13:18] cory dot nemelka at nemelkaitgroup dot com Description: ------------ Since upgrading from PHP v5.0 to PHP v5.1, the dbase_open function no longer works. The problem appears to be a byte-ordering problem in the "file-type" byte of the header (offset 0). The problem is illustrated below. This file opens properly under PHP v5.0 but returns an "unable to get header" under v5.1. Reproduce code: --------------- # od -tx1 mattndea.dbf | head 0000000 30 06 0a 04 eb ac 03 00 08 03 33 00 00 00 00 00 0000020 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 0000040 4d 45 4d 42 45 52 5f 49 44 00 00 43 01 00 00 00 0000060 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000100 44 41 54 45 00 00 00 00 00 00 00 44 0d 00 00 00 0000120 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000140 54 49 4d 45 00 00 00 00 00 00 00 43 15 00 00 00 0000160 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000200 4c 4f 43 41 54 49 4f 4e 00 00 00 43 1c 00 00 00 0000220 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # od -tx2 mattndea.dbf | head 0000000 0630 040a aceb 0003 0308 0033 0000 0000 0000020 0000 0000 0000 0000 0000 0000 0300 0000 0000040 454d 424d 5245 495f 0044 4300 0001 0000 0000060 000c 0000 0000 0000 0000 0000 0000 0000 0000100 4144 4554 0000 0000 0000 4400 000d 0000 0000120 0008 0000 0000 0000 0000 0000 0000 0000 0000140 4954 454d 0000 0000 0000 4300 0015 0000 0000160 0007 0000 0000 0000 0000 0000 0000 0000 0000200 4f4c 4143 4954 4e4f 0000 4300 001c 0000 0000220 0004 0000 0000 0000 0000 0000 0000 0000 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39170&edit=1
