|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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 ...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 12:00:01 2025 UTC |
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.