ellandrd
asked on
permission denied
i have a PHP file in a folder on another server in our office:
\\file02abzpi\foldername\f ilename.ph p (file server)
\\mail01abzpi\wwwroot\inde x.php (mail server)
im trying to include the PHP page that exists on the file server in my page that exists on the mail server but im getting this:
Warning: include_once(//File02abzpi /foldernam e/filename .php) [function.include-once]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\index.p hp on line 2
Warning: include_once() [function.include]: Failed opening '//File02abzpi/foldername/ filename.p hp' for inclusion (include_path='.;C:\php5\p ear') in c:\Inetpub\wwwroot\index.p hp on line 2
the folder on the file server has IIS user permission enabled to allow the user to read/list and execute files...
my code:
<?php
include_once('//File02abzp i/folderna me/filenam e.php');
?>
\\file02abzpi\foldername\f
\\mail01abzpi\wwwroot\inde
im trying to include the PHP page that exists on the file server in my page that exists on the mail server but im getting this:
Warning: include_once(//File02abzpi
Warning: include_once() [function.include]: Failed opening '//File02abzpi/foldername/
the folder on the file server has IIS user permission enabled to allow the user to read/list and execute files...
my code:
<?php
include_once('//File02abzp
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can't use / for UNC paths.
you need to use \\ instead.
see if:
========================== ========== =
<?php
include_once('\\File02abzp i\folderna me\filenam e.php');
?>
========================== ========== =
works
It should be possible to map a drive so that x:\ will load the folder and then you can use x:\filename.php
Basically logging in and mapping a drive under the IISUser Account.
you need to use \\ instead.
see if:
==========================
<?php
include_once('\\File02abzp
?>
==========================
works
It should be possible to map a drive so that x:\ will load the folder and then you can use x:\filename.php
Basically logging in and mapping a drive under the IISUser Account.
ASKER
ok ive mapped a drive to the other server and its called:
Timesheets on 'File02abzpi\Company'
so what would be include_once() be like now?
Timesheets on 'File02abzpi\Company'
so what would be include_once() be like now?
<?php
include_once('<drive>:\<fi lename>.ph p');
?>
Should be something along the lines of the above.
include_once('<drive>:\<fi
?>
Should be something along the lines of the above.
ASKER
no - it didnt work - failed to open stream...
What about
include_once('\\File02abzp i\folderna me\filenam e.php');
?
include_once('\\File02abzp
?
If you have the right, give a readonly access to 'Everyone' to the folder \\file02abzpi\foldername and try like that.
Are you sure you have - on the file server - enabled the permission for the CORRECT IISUSR ?
because you need to give read permissions to the share/file in question to the IISUSR running on the webserver (the local account there), and not to some (I'm guessing here) Active Directory IISUSR.
mapping a share to a path and then trying won't work as the mapping will be disconnected as soon as the IISUSR account logs out of the machine; either way, I don't think it's the best way to do it anyhow.
if you are not certain yet, ellandrd, you can try this blanket approach:
make a share on the fileserver, call it whatever, set to everyone full access (in share properties) and also give everyone full access in security tab. then place a file in there.
now see if you still have that error.
if not, it works and it's definately something with your permissions; try to narrow them down until you have it.
if you still have the error, the fault lies somewhere else and you should provide us with the new information.
I hope this helps,
Andy
because you need to give read permissions to the share/file in question to the IISUSR running on the webserver (the local account there), and not to some (I'm guessing here) Active Directory IISUSR.
mapping a share to a path and then trying won't work as the mapping will be disconnected as soon as the IISUSR account logs out of the machine; either way, I don't think it's the best way to do it anyhow.
if you are not certain yet, ellandrd, you can try this blanket approach:
make a share on the fileserver, call it whatever, set to everyone full access (in share properties) and also give everyone full access in security tab. then place a file in there.
now see if you still have that error.
if not, it works and it's definately something with your permissions; try to narrow them down until you have it.
if you still have the error, the fault lies somewhere else and you should provide us with the new information.
I hope this helps,
Andy
Once you set the right, include the file the following way (do not do a mapping):
include("//file02abzpi/fol dername/fi lename.php ");
forward slash, and not backsklash.
include("//file02abzpi/fol
forward slash, and not backsklash.
ASKER