php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57141 px_set_blob_file doesn't find BLOB file
Submitted: 2006-07-13 07:40 UTC Modified: 2017-04-01 21:08 UTC
From: bzapf at online dot de Assigned:
Status: Wont fix Package: Paradox (PECL)
PHP Version: 5.1.2 OS: Debian Linux 2.6.8
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-07-13 07:40 UTC] bzapf at online dot de
Description:
------------
When px_set_blob_file is called with a blob file that isn't reffered to absolutely, or that is in a "good" spot (the WD for PHP, whatever that may be generally), then it isnt found - this is dramatic when working in apache.

strace reveals that there is no path prepended in that case, although this happens in px_open_fp - probably the code is omitted in px_set_blob_file.

A Workaround obviously is to specify the path absolutely.

This is -extremely- confusing nevertheless (php finds file, pdoxlib does not - wtf?)

Reproduce code:
---------------
make a subdirectory, put X.DB and X.MB there. Then, make a script along the lines of:

$px=px_new();
$fp=fopen('X.DB','r');
px_open_fp($px,$fp);
px_set_blob_file($px,'X.MB');

Expected result:
----------------
(no error message)

Actual result:
--------------
Fatal error: px_set_blob_file() [<a href='function.px-set-blob-file'>function.px-set-blob-file</a>]: Could not open blob file. in /var/www/Script/script2.php on line ...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-17 23:48 UTC] emmanuelh92 at hotmail dot com
after having the same problem, i look at the source code in paradox.c and i found the origin of the problem in the "PX_open_blob_file" function, it is this line that return -1 at the origin of the error message "could not open file":

	if((fp = fopen(filename, "r+")) == NULL) {
		return -1;
	}

it is caused by the "r+" mode in fopen : fopen needs read and write access to .mb file so the solution is to allowed write access to the .mb file.
To me it is resolved the problem. dont know if write access is a good thing for blob file that we want only read.
anyway it works fine.
 [2017-04-01 21:08 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 21:08 UTC] tpunt@php.net
Due to this extension not seeing any activity since 2007, this issue will not be fixed. We are therefore closing this now.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Oct 22 13:01:29 2019 UTC