Last modified: 2014-06-02 11:20:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37890, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35890 - IIS File Not Found Issue due to permissions (problem identified)
IIS File Not Found Issue due to permissions (problem identified)
Status: NEW
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.18.x
All All
: Low major (vote)
: ---
Assigned To: Nobody - You can work on this!
: testme
Depends on:
Blocks: iis
  Show dependency treegraph
 
Reported: 2012-04-11 18:10 UTC by Freer
Modified: 2014-06-02 11:20 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Freer 2012-04-11 18:10:02 UTC
Installed Mediawiki on IIS just fine. Skinned it. Went to upload file, got a 500 internal server error. Triple checked everything, ends up being the file permissions on the images folder.

So, went into the server and changed the file permissions on the images folder, and the subfolders therein.

Here's the catch: the file permissions on the newly created subfolders are all denied all permissions for IUSR_****. I tried setting what I think is the folder creation function to 0777 permissions rather than a variable, no luck.

So, I'm not an IIS guy (client wanted this specifically).

I can go in and set the permissions on the folder each time they upload an image manually on the server (then it works just fine), but that's counterproductive. I've found a few pages with a similar bug floating around google. I've managed to identify the sub-folder-creation issue, but don't know how to fix it for IIS.

HELP! 

Thanks
Comment 1 Bawolff (Brian Wolff) 2012-04-11 18:37:47 UTC
Bugzilla isn't really a support fourm...

500 error would usually mean php fatal error (Which should not happen on permission error). Please enable error logging on php, and tell us what the actual error message is.
Comment 2 Bryan Tong Minh 2012-04-11 18:51:46 UTC
Presumably we need some Windows-specific magic in wfMkDirParents() or whatever that function is called.
Comment 3 Freer 2012-04-11 18:58:13 UTC
It's an accessed denied error for sure, though I agree it's odd that it presents this way.

How would I enable php errors? I have this is a subfolder (/wiki/) none of the errors are showing up in my root error_log and I don't see any other error_log files in the /wiki/ folder or subfolders.

It's definitely an access issue. I upload the file successfully, but I can't view it. I go into the images folder, set all children to have full access permissions, and then I can view it. It needs to have the correct permissions in IIS, and I do believe that it falls under bugs, just happens to be one that I have an immediate need to have fixed. 

Essentially, the wfMkdirParents function in GlobalFunctions.php needs to have the mkdir function changed, or the $mode variable changed, when using IIS. The folders it is creating do not have the correct permissions, even with the /images/ directory set explicitly to recurs permissions to all children. I'd change it myself, but I simply do not have the experience with the PHP/ISS mix to get the permissions set using PHP. In php/apache or .net/iis this is a simple function. I couldn't find ANYTHING useful on the web about how to override permissions using php on iis. 

As I've found this "bug" unresolved on other forums, and with a much less clear identification of the "bug", I thought it would be proactive to post it here. Ideally, a conditional for iis folder creation vs apache folder creation in future versions will clear this up.
Comment 4 Freer 2012-04-11 18:58:48 UTC
Bryan, yes, in a nutshell I believe you're right.
Comment 5 Freer 2012-04-11 20:04:59 UTC
After much poking and hair pulling:

We had to create an all-encompassing user and assign them all permissions in C:/windows/temp/

Also, we disabled the sub-directory saving for images, so that they are all saved directly in the default /images/ folder.

If there's a way around this, that'd be great, it's probably not good for security, but for now we can get our images working.

Thanks
Comment 6 Mark A. Hershberger 2012-04-11 21:11:31 UTC
marking confirmed re comment #5
Comment 7 Bawolff (Brian Wolff) 2012-04-11 23:10:49 UTC
(In reply to comment #3)
> 
> Essentially, the wfMkdirParents function in GlobalFunctions.php needs to have
> the mkdir function changed, or the $mode variable changed, when using IIS. The
> folders it is creating do not have the correct permissions, even with the
> /images/ directory set explicitly to recurs permissions to all children. I'd
> change it myself, but I simply do not have the experience with the PHP/ISS mix
> to get the permissions set using PHP. In php/apache or .net/iis this is a
> simple function. I couldn't find ANYTHING useful on the web about how to
> override permissions using php on iis. 
> 

All docs i can find say that php totally ignores the mode argument of mkdir when running under windows.

Not sure where that leaves us...
Comment 8 Bryan Tong Minh 2012-09-18 13:33:29 UTC
(In reply to comment #7)
> (In reply to comment #3)
> > 
> > Essentially, the wfMkdirParents function in GlobalFunctions.php needs to have
> > the mkdir function changed, or the $mode variable changed, when using IIS. The
> > folders it is creating do not have the correct permissions, even with the
> > /images/ directory set explicitly to recurs permissions to all children. I'd
> > change it myself, but I simply do not have the experience with the PHP/ISS mix
> > to get the permissions set using PHP. In php/apache or .net/iis this is a
> > simple function. I couldn't find ANYTHING useful on the web about how to
> > override permissions using php on iis. 
> > 
> 
> All docs i can find say that php totally ignores the mode argument of mkdir
> when running under windows.
> 
> Not sure where that leaves us...

Shelling out to cacls.exe to do its dirty magic. Not sure how desired that is though...
Comment 9 Andre Klapper 2013-09-04 12:25:49 UTC
(In reply to comment #3)
> How would I enable php errors?

http://www.mediawiki.org/wiki/Manual:How_to_debug (if it's still an issue)
Comment 10 Andre Klapper 2014-05-16 22:36:52 UTC
Freer: Which IIS version is this about, and does this problem still happen in a currently supported MediaWiki version?
Comment 11 Andre Klapper 2014-06-02 11:20:08 UTC
Freer: Which IIS version is this about, and does this problem still happen in a currently supported MediaWiki version?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links