Re: file_exists() with Windows share




> Running PHP5 with IIS on a Win2K Server

You can get the same problem with PHP 4.x, but for different reasons.

> whenever I try file_exists() on a file in a windows share on another
> server I get a response of False - I can't open the file or do anything
> with it. I'm sure the filename/path is Ok

For PHP 4.x, all file operations assume the local file system
(effectively, "file://" is prepended to the given filename before
operating on it.) The workaround is to use drive letters instead.

For PHP 5.x, you can work with UNC shares BUT there are caveats: (1)
from the manual "...this function returns FALSE for files inaccessible
due to safe mode restrictions." and (2), note this comment about
running under domain accounts:
<http://aspn.activestate.com/ASPN/Mail/Message/phpdoc/1183917> Check
permissions for the folder and file are appropriate for the web server
account.

---
Steve

.



Relevant Pages

  • Re: PHP Instalation problems. Browser doesnt know what to do
    ... This is loaded and run as a local server (for class ... PHP 5.2.0 from php-5.2.0-win32-installer.msi ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)
  • Re: PHP Instalation problems. Browser doesnt know what to do
    ... This is loaded and run as a local server (for class ... PHP 5.2.0 from php-5.2.0-win32-installer.msi ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)
  • Re: write with cURL
    ... execute permissions. ... This is assuming that the PHP script runs ... of potential security risks from other users on the same server. ... Apache as the global web server user and thus needs world write ...
    (alt.php)
  • mysqli error?
    ... I'm just setting up my php enviroment and I typed in a simple script ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)
  • Re: write with cURL
    ... execute permissions. ... This is assuming that the PHP script runs ... of potential security risks from other users on the same server. ... web server itself is part of the group. ...
    (alt.php)