DBF + PHP

DBF + PHP

am 17.07.2007 23:06:29 von Luke

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 ?
dbase_open('c:\tmp\test.dbf', 0) - not working
dbase_open('c:\\tmp\test.dbf', 0) - not working
dbase_open('c:/tmp/test.dbf', 0) - not working
Any idea?

Thanks.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DBF + PHP

am 19.07.2007 02:16:08 von dmagick

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/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DBF + PHP

am 19.07.2007 19:34:34 von Luke

> 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/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DBF + PHP

am 19.07.2007 19:48:54 von Instruct ICC

>From: "Luke"
>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/home/?source=hmtextlinkjuly0 7

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DBF + PHP

am 19.07.2007 23:02:01 von Frode

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 confused. Why are you using Windows-style paths
("c:\\..") on something that looks to be a un*x server ("/usr/local...")

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DBF + PHP

am 19.07.2007 23:05:12 von Luke

""Instruct ICC"" wrote in message
news:BAY134-F3036CB3BF671A37DB9CBD1B6FB0@phx.gbl...
> >From: "Luke"
>>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.

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/home/?source=hmtextlinkjuly0 7

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DBF + PHP

am 19.07.2007 23:14:52 von Luke

wrote in message
news:20070719210201.GC16135@fearless.intra.coretrek.com...
> 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 confused. 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.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DBF + PHP

am 20.07.2007 00:05:11 von Instruct ICC

>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/hotmail/?locale=en-us&ocid=TX T_TAGHM_migration_HM_mini_2G_0507

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: DBF + PHP

am 20.07.2007 00:09:07 von Instruct ICC

>>$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/hotmail/?locale=en-us&ocid=TX T_TAGHM_migration_HM_mini_pcmag_0507

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php