Solved

permission denied

Posted on 2006-11-16
10
577 Views
Last Modified: 2008-02-01
i have a PHP file in a folder on another server in our office:

\\file02abzpi\foldername\filename.php (file server)

\\mail01abzpi\wwwroot\index.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/foldername/filename.php) [function.include-once]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\index.php on line 2

Warning: include_once() [function.include]: Failed opening '//File02abzpi/foldername/filename.php' for inclusion (include_path='.;C:\php5\pear') in c:\Inetpub\wwwroot\index.php 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('//File02abzpi/foldername/filename.php');
?>
0
Comment
Question by:ellandrd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 13

Accepted Solution

by:
rhickmott earned 500 total points
ID: 17955573
This may be an issue do to the way PHP handles paths and UNC adresses.

Try logging on as the IISUser and mapping a drive to the share.
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17955638
i have also tried creating a shortcut pointing to foldername/filename.php in the mail server but i get no such directory...
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17955666
you can't use / for UNC paths.
you need to use \\ instead.

see if:
=====================================
<?php
include_once('\\File02abzpi\foldername\filename.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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Author Comment

by:ellandrd
ID: 17955689
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?
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17955697
<?php
include_once('<drive>:\<filename>.php');
?>

Should be something along the lines of the above.
0
 
LVL 16

Author Comment

by:ellandrd
ID: 17955740
no - it didnt work - failed to open stream...
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 17956054
What about

include_once('\\File02abzpi\foldername\filename.php');

?
0
 
LVL 1

Expert Comment

by:Wongy
ID: 17956061
If you have the right, give a readonly access to 'Everyone' to the folder \\file02abzpi\foldername and try like that.
0
 
LVL 4

Expert Comment

by:AndyAelbrecht
ID: 17956094
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
0
 
LVL 1

Expert Comment

by:Wongy
ID: 17956097
Once you set the right, include the file the following way (do not do a mapping):

include("//file02abzpi/foldername/filename.php");

forward slash, and not backsklash.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Link failure 16 63
JQuery Search Filter 2 69
Change a button after e-mail 4 20
How do i use the await event in php echo 5 18
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question