|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38357 dbase_open can't open DBase 3 dbf file.
Submitted: 2006-08-06 13:55 UTC Modified: 2006-08-14 09:42 UTC
From: rodrigo at fabricadeideias dot com Assigned: mike (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 5.1.4 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
26 - 6 = ?
Subscribe to this entry?

 [2006-08-06 13:55 UTC] rodrigo at fabricadeideias dot com
When trying to open a DBase 3 dbf file I get the following error:

Unable to get header

Warning: dbase_open(): unable to open database 12MU2500G.dbf in /var/www/localhost/htdocs/shape/dbase_open_bug.php on line 4

I believe this is a DBase 3 file as file returns:

# file 12MU2500G.dbf
12MU2500G.dbf: DBase 3 data file (22 records)

I also believe this file isn't corrupted as both DBD::XBase module for Perl and OpenOffice Base read the file without problems.

Reproduce code:
$db = dbase_open('12MU2500G.dbf', 0);
echo $db ? "Opened.\n" : "Not opened.\n";

Expected result:

Actual result:
Unable to get header

Warning: dbase_open(): unable to open database 12MU2500G.dbf in /var/www/localhost/htdocs/shape/dbase_open_bug.php on line 2
Not opened.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-06 14:00 UTC] rodrigo at fabricadeideias dot com
There is a downloadable copy of the dbf file at <>.
 [2006-08-06 16:01 UTC]
"F" (float?) fields are not supported, so I changed the report to FR.

Can you post a record with all values, how it should look like?

 [2006-08-06 22:02 UTC] rodrigo at fabricadeideias dot com
There are float fields in this dbf file. As per XBase file definition (<>) F fields are floating fields represented as up to 20 digits.

Here is a complete record of the .dbf file (as per Perl reading):

AREA_1: 2984.643
NOME: Porto Acre
PERIMETRO_: 270.266
CODIGO: 1200807
AREA_TOT_G: 2984.643
GEOCODIGO: 1200807
 [2006-08-08 13:33 UTC] rodrigo at fabricadeideias dot com
I have a patch available at <> that implements floating field support for php's dbase functions.

I've tried 3 times to subscribe to <> to send this patch without success: there's definitely something wrong with the subscribe process as I never receive the first email the system is supposed to send me during the subscription process.

Please consider it for inclusion. The patch is relative to the relased 5.1.4 version.
 [2006-08-08 14:58 UTC]
I'll take a look at it.

The php-dev list has been closed long time ago.
 [2006-08-14 09:42 UTC]
Implemented in PHP_5_2 and HEAD.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jan 18 12:01:23 2020 UTC