473,372 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

PHP & NTFS Permissions

Hello group!

I'm having a problem and I hope some of you may be able to point me in the
right direction.

I inherited a web site using php, running on Windows 2000 & IIS. The site
was developed by a consulting firm about a year before I came on board, the
consultant has since gone out of business. Overall, I've never had a
problem with the site and have been able to figure out nearly everything
they configured on it.

The server with the site is getting old, so I'm trying to migrate it to a
new box. I've configured the new box to be identical to the old one - in
terms of partition layout, directory structure, NTFS users / groups & NTFS
permissions, php.ini, etc. I have php installed with IIS & it is working
properly. All aspects of the site work, except for one. We have a feature
that allows users to log in to a file manager & edit existing pages. When I
try to edit one of thes pages, I get an fopen error, complaining that
permission is denied.

To reach this file manager, the users log in twice. They first log in using
a web-based form, which pulls their user details from MySQL. To reach the
file manager itself, they have to enter a username / password using basic
IIS authentication (the pop-up box). The username / password they use to
access the file manager is a local account on the web server.

The user they are logging in as has full NTFS permission on the web root.
When they attempt to edit a file, the php script is supposed to create a
temp "lock" file in the current directory. When the script attempt to
create this temp file, the "permission denied" error is generated.

If I set the Everyone group to have write permission on the web root, the
problem goes away. Obviously, I don't want to do this. This was not needed
on the old server.

My question, seeing as my users / permissions / etc on the new machine match
what I have on the old machine, why would I be having this "permission
denied" error. What user would php try to create the file as??

The files, as well as the directories, in question here have the proper
permissions set - at least they match what I have on the old server.

Doing a phpinfo(); on the old server & new server shows identical values for
temp files, etc etc.

What could I be missing here?

Thanks a bunch!

(reply to group only please)
Jul 16 '05 #1
1 7985
BingoHandJob wrote:
Hello group!

I'm having a problem and I hope some of you may be able to point me in the
right direction.

I inherited a web site using php, running on Windows 2000 & IIS. The site
was developed by a consulting firm about a year before I came on board, the
consultant has since gone out of business. Overall, I've never had a
problem with the site and have been able to figure out nearly everything
they configured on it.

The server with the site is getting old, so I'm trying to migrate it to a
new box. I've configured the new box to be identical to the old one - in
terms of partition layout, directory structure, NTFS users / groups & NTFS
permissions, php.ini, etc. I have php installed with IIS & it is working
properly. All aspects of the site work, except for one. We have a feature
that allows users to log in to a file manager & edit existing pages. When I
try to edit one of thes pages, I get an fopen error, complaining that
permission is denied.

To reach this file manager, the users log in twice. They first log in using
a web-based form, which pulls their user details from MySQL. To reach the
file manager itself, they have to enter a username / password using basic
IIS authentication (the pop-up box). The username / password they use to
access the file manager is a local account on the web server.

The user they are logging in as has full NTFS permission on the web root.
When they attempt to edit a file, the php script is supposed to create a
temp "lock" file in the current directory. When the script attempt to
create this temp file, the "permission denied" error is generated.

If I set the Everyone group to have write permission on the web root, the
problem goes away. Obviously, I don't want to do this. This was not needed
on the old server.

My question, seeing as my users / permissions / etc on the new machine match
what I have on the old machine, why would I be having this "permission
denied" error. What user would php try to create the file as??

The files, as well as the directories, in question here have the proper
permissions set - at least they match what I have on the old server.

Doing a phpinfo(); on the old server & new server shows identical values for
temp files, etc etc.

What could I be missing here?

Thanks a bunch!

(reply to group only please)


Could be that IIS is running as a user with insufficient permissions
(who the user logs in to your web page as is irrelevent). Go to the
services control pannel and look for the world wide web servivice item.
select properties and view/change who the web server runs as.

Another remote posibility is that you can "log" the users in without
logging them in. ie. uncheck the box with "Allow anonymous connections"
somewhere in IIS). If you need to make sure they have access, there is
an environement variable now populated (think it is called NTAUTH_LOGIN)
or something which you can use (check phpinfo()). This will be their
windows login name. MAYBE stuff will run under this user's credentials.

Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: travelling_nerd | last post by:
Hi, I'm trying to write a script that will allow validated users to download a file that has specific ntfs permissions. Here's a summary: Scenario: 1) The name of the file is "binary.zip"....
9
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
2
by: Ram | last post by:
Hey, I'v managed to find a way of adding NTFS permissions to a certain folder, But the problem is, the folder has a couple of inherited permissions which I want to delete. How can I remove the...
0
by: David Kyle | last post by:
Hello, Iím currently having some difficulties finding an example and the recommended practices for setting NTFS Permissions on Files and Folders. I will also need to do some impersonation and I...
0
by: VP | last post by:
Hi there, well i am stuck on a problem with regards to obtaining security permissions on folders. At the moment I have created a simple treeview example which shows all sub-directories in a tree...
4
by: Ram | last post by:
Hey, I'v managed to find a way of adding NTFS permissions to a certain folder, But the problem is, the folder has a couple of inherited permissions which I want to delete. How can I remove the...
3
by: Ray Cassick \(Home\) | last post by:
I am starting to think there is some kind of conspiracy :) but everywhere I try to locate some (working) code showing how to change NTFS partitions on a network share I end up at a dead end. I...
8
by: paquer | last post by:
Database Users need to have Read/Write etc... permissions to the folder where the Database resides in order to create the lock file. I have read only users. I have set up the Shortcut that links...
3
by: palepimp | last post by:
Hello all, I have searched far and wide for a solution to my issue. In short, here is the problem: 1. 3 PC's enter data into an Access 2003 database (PC's are running Vista w/ Office 2007...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.