Hi Shawn,
If you run the script without supressiung the warnings you would perhaps see the reson
:-)
When running the script from the command line PHP hase the same access rights as the
user executing the script. When executing through a request to a web server, PHP has
the same access rights as the user running the web process.
Check the access rights to the directory and files that you try to open.
- Frank
> Can anyone tell me why the following code won't work when I call it through
> Apache, but it DOES work when I do it in a Command Prompt?
>
> It gives me 0 when I run it through Apache. I'm have PHP set up to run as
> CGI. PHP 4.0.6 w/ latest 4.0.7-dev snapshot on top.
>
> What I'm going to end up doing is copying the files from an UNC path over to
> the local server (running PHP), but I can't get anything to work with UNC
> paths when called through Apache, not even a system call to "move". But
> everything always works in a Command Prompt. If you can think of another
> way I could do this on demand, I would greatly appreciate it, as this is
> driving me crazy!
>
> <?
> if ($dir = @opendir("//workstation//test")) {
> while($file = readdir($dir)) {
> if ($file !="." && $file !="..")
> $arFiles[] = $file;
> }
> }
> ?>
> File_Array Count: <? $asize = sizeof($arFiles);
> print $asize; ?>
>
> Thanks,
> Shawn Sellars
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]