php-windows Digest 18 Sep 2006 11:12:41 -0000 Issue 3037
Topics (messages 27146 through 27148):
Re: Problems accessing the net units through PHP
27146 by: Dale Attree
27147 by: Alex Turner
cookies time?
27148 by: German Piqué
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
PHP on windows does not support mapped network drives, you would need to use
sockets and connect to the IP of the machine you wish to write to.
-----Original Message-----
From: German Piqué [mailto:[EMAIL PROTECTED]
Sent: 13 September 2006 08:25 AM
To: php-windows
Subject: [PHP-WIN] Problems accessing the net units through PHP
Well, first of all i want to apologise for my poor english.
My problem is that I have problems accessing net mounts on windows. For
example, if R: is a unit attatched from the internal net and I try to access
it, I get error. The following code is what I'm trying to do to test the
access:
----------------------------------------------------------------------------
----------------------
echo "<a href='" . $filename2 . "'> arxiu </a><br>";
if($error=basename($filename2)) echo $error . ": basename<br>";
else echo $error . ": basename<br>";
if($error=disk_free_space('G:')) echo $error . " G: free space<br>";
else echo $error . " G: There isn't free space<br>";
if($error=copy($filename2,'.')) echo "Copy successfull<br>";
else echo $error . " Copy successless<br>";
if($error=is_readable($filename2)) echo "Read successfull<br>";
else echo $error . ": The file cannot be readed<br>";
if($error=file_exists($filename2)) echo "File Exists<br>";
else echo $error . ": The file doesn't exists<br>";
----------------------------------------------------------------------------
--------
--------------
$filename2 is the path to a file in a net mount.
and the output is:
------------------------------------------------------------
loss_of_supervision: basename
G: There isn't free space
Copy successless
: The file cannot be readed
: The file doesn't exists
------------------------------------------------------------
I try the same code with C: unit and a file inside it and works fine...
There's some kind of bug or it's my server's configuration that is wrong?
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.3/445 - Release Date: 2006/09/11
--- End Message ---
--- Begin Message ---
Dale Attree wrote:
PHP on windows does not support mapped network drives, you would need to use
sockets and connect to the IP of the machine you wish to write to.
-----Original Message-----
From: German Piqué [mailto:[EMAIL PROTECTED]
Sent: 13 September 2006 08:25 AM
To: php-windows
Subject: [PHP-WIN] Problems accessing the net units through PHP
Well, first of all i want to apologise for my poor english.
My problem is that I have problems accessing net mounts on windows. For
example, if R: is a unit attatched from the internal net and I try to access
it, I get error. The following code is what I'm trying to do to test the
access:
----------------------------------------------------------------------------
----------------------
echo "<a href='" . $filename2 . "'> arxiu </a><br>";
if($error=basename($filename2)) echo $error . ": basename<br>";
else echo $error . ": basename<br>";
if($error=disk_free_space('G:')) echo $error . " G: free space<br>";
else echo $error . " G: There isn't free space<br>";
if($error=copy($filename2,'.')) echo "Copy successfull<br>";
else echo $error . " Copy successless<br>";
if($error=is_readable($filename2)) echo "Read successfull<br>";
else echo $error . ": The file cannot be readed<br>";
if($error=file_exists($filename2)) echo "File Exists<br>";
else echo $error . ": The file doesn't exists<br>";
----------------------------------------------------------------------------
--------
--------------
$filename2 is the path to a file in a net mount.
and the output is:
------------------------------------------------------------
loss_of_supervision: basename
G: There isn't free space
Copy successless
: The file cannot be readed
: The file doesn't exists
------------------------------------------------------------
I try the same code with C: unit and a file inside it and works fine...
There's some kind of bug or it's my server's configuration that is wrong?
An alternative is to use COM to talk to the FileSystemObject because
that supports both mapped network drives and UNC file paths. If you
need binary access (which FSO does not support) you can use the stream
objects from ADODB as long as you have version 2.5 or above(again,
access from COM).
I wrote how to do the ADODB thing (though in javascript - but the
principle is the same) in the deployview blog:
http://deployview.com/blog/2006/07/dumpster-diving-with-scripts.html
Please remember to only create a COM object once per session (ie at the
top of the script) as creating them is expensive. If you have a lot of
threads trying to create them, the lookup functions into the registry
seem to become a bottle neck.
Cheers
AJ
--
www.deployview.com
www.nerds-central.com
www.project-network.com
--- End Message ---
--- Begin Message ---
Well, reading the documentation about cookies i saw that the function time()
works using UNIX epochs. If I try to use this function (or mktime) in
windows, the php shows a white page, like there's an error somewhere.
It's a problem with windows machine's or there's another solution to this?
Meanwhile, I put no time option (so cookie expires at the end of the
session) but i would like to try to set up a timeout.
I don't demand absolute solutions, I only want a clue to work on.
Thank you :)
--- End Message ---