Home > Archive > PHP DB > July 2007 > Re: [PHP-DB] DBF + PHP
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [PHP-DB] DBF + PHP
|
|
|
| Luke wrote:
> Hi.
> I need open some dbase files. Function dbase_open work correctly only when I
> open data base from server eg. dbase_open('/tmp/test.dbf', 0).
> How Can I open this database from local host ?
What errors are you getting? Check file permissions, maybe you can't
read/write the file.
--
Postgresql & php tutorials
http://www.designmagick.com/
| |
|
|
> What errors are you getting? Check file permissions, maybe you can't
> read/write the file.
I get warning:
Warning: dbase_open() [function.dbase-open]: unable to open database
c:\temp\test.dbf in /usr/local/lappstack-1.1/apache2/htdocs/dbase.php on
line 8
In php.ini I have safe_mode=off. Even if I wont simple change a directory
by:
echo getcwd() . "\n";
chdir('c:\\temp');
echo getcwd() . "\n";
I get this warning:
/usr/local/lappstack-1.1/apache2/htdocs
Warning: chdir() [function.chdir]: No such file or directory (errno 2) in
/usr/local/lappstack-1.1/apache2/htdocs/dbase.php on line 5
/usr/local/lappstack-1.1/apache2/htdocs
And how you see the directory does't change :(((((((((
Some propositin?
THANKS ALL :)
echo getcwd() . "\n";
chdir('c:\\Przewozy\\BAZY');
echo getcwd() . "\n";
$db = dbase_open("c:\\Przewozy\\BAZY\\Ceny.dbf", 0);
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
| |
| Instruct ICC 2007-07-19, 6:58 pm |
| >From: "Luke" <scrooge@onet.eu>
>echo getcwd() . "\n";
>chdir('c:\\temp');
>echo getcwd() . "\n";
>chdir('c:\\Przewozy\\BAZY');
>echo getcwd() . "\n";
>
>$db = dbase_open("c:\\Przewozy\\BAZY\\Ceny.dbf", 0);
Just a quick guess/suggestion:
Single tick quotes ' are taken literally and double tick quotes " allow
expansion.
$aVariable = 0;
echo '$aVariable';//$aVariable
echo "$aVariable";//0
Maybe change the chdir to use double quotes or remove the double backslash?
Especially if your dbase_open works with double quotes and the double
backslash.
________________________________________
_________________________
http://im.live.com/messenger/im/hom...mtextlinkjuly07
| |
| frode@CoreTrek.no 2007-07-19, 6:58 pm |
| On Thu, Jul 19, 2007 at 19:34:34 +0200, Luke wrote:
> I get this warning:
> /usr/local/lappstack-1.1/apache2/htdocs
> Warning: chdir() [function.chdir]: No such file or directory (errno 2) in
>
> echo getcwd() . "\n";
> chdir('c:\\Przewozy\\BAZY');
> echo getcwd() . "\n";
You seem horribly . Why are you using Windows-style paths
("c:\\..") on something that looks to be a un*x server ("/usr/local...")
| |
|
|
""Instruct ICC"" <instructicc@hotmail.com> wrote in message
news:BAY134-F3036CB3BF671A37DB9CBD1B6FB0@phx.gbl...
>
>
> Just a quick guess/suggestion:
> Single tick quotes ' are taken literally and double tick quotes " allow
> expansion.
> $aVariable = 0;
> echo '$aVariable';//$aVariable
> echo "$aVariable";//0
> Maybe change the chdir to use double quotes or remove the double
> backslash? Especially if your dbase_open works with double quotes and the
> double backslash.
Thanks, but it did't help :(. I still get the some error.
I thing it is something with php configuration ?
Some other suggestion?
>
> ________________________________________
_________________________
> http://im.live.com/messenger/im/hom...mtextlinkjuly07
| |
|
|
<frode@CoreTrek.no> wrote in message
news:20070719210201.GC16135@fearless.intra.coretrek.com...
> On Thu, Jul 19, 2007 at 19:34:34 +0200, Luke wrote:
>
> You seem horribly . Why are you using Windows-style paths
> ("c:\\..") on something that looks to be a un*x server ("/usr/local...")
Becouse I wont read files, exactly *.dbf, from local machine, not from
server. I have no problem with read or changing directory, if database is
located on server.
Thanks for any suggestion.
| |
| Instruct ICC 2007-07-19, 6:58 pm |
| >Becouse I wont read files, exactly *.dbf, from local machine, not from
>server. I have no problem with read or changing directory, if database is
>located on server.
>
>Thanks for any suggestion.
So you are running PHP on your local machine "localhost" which happens to be
a Windows machine, and also was compiled with the --enable-dbase option?
Are you only dealing with 1 machine and it is not a UNIX flavor?
If you had a web page served from a UNIX box with an html file field (like
Upload this file) that you view from a browser on a Windows box, which
browses the local machine, the different file path styles could make sense.
Or if dbase_open could connect to a remote server like fopen.
If you are trying to use dbase_open on your local machine to connect to a
remote machine's test.dbf, it looks like this function does not work across
servers. Maybe use fopen and friends to get the remote file?
________________________________________
_________________________
http://imagine-windowslive.com/hotm..._2G_0507
| |
| Instruct ICC 2007-07-19, 6:58 pm |
| >>$db = dbase_open("c:\\Przewozy\\BAZY\\Ceny.dbf", 0);
Or if you can map the drive, then you should be able to use a path like
above using the mapped drive or \\server\volume\path\test.dbf
Can you call up the file in Windows Explorer?
________________________________________
_________________________
http://imagine-windowslive.com/hotm...mag_0
507
|
|
|
|
|