Topic: Windows Install: Test and Configuration Failures

We're attempting to get a prototype SVmanager installation working before recommending that a number of public  libraries purchase it for their onlilne gallery needs. All the installations will all take place on Windows 2008 Web Editiion servers.

So far, we're having issues with both the test module and SVmanager.

We've set the following permissions on the "svmanager" and "svmtest" folders for the anonymous Internet user account:  MODIFY, READ & EXECUTE, LIST FOLDER CONTENTS, READ, WRITE.

Running the test module goes fine until the "Upload Test".  We can add a file, but when we select the UPLOAD button, we get a dialog box with the following message:

"Error Occurred. Statuscode 500."

A check of the IIS log for the site shows the following (domain name and IP altered)

2010-12-03 17:55:16 W3SVC39 WDO-MAWGWA 000.00.00.00 POST /svmtest/myupload.php path=E%3A%5Csites%5Cdev8%5Csvmtest%5Cuploads%5C 80 - 172.16.84.193 HTTP/1.0 MyUploader/1.13 - - www.subname.ourdomain.org 500 0 0 1399 11908 234

Switching over to SVManager itself, we find we can login with the default admin account, create a gallery, unlist a gallery and even upload an image (Statuscode 500 does not appear). However, when we attempted to use the "Admin" tab to replace the default login/password, we received the following messages back:

1. Warning: file_put_contents(data\user.php) [function.file-put-contents]: failed to open stream: Permission denied (auth.php, line 184)

2. Warning: Unable to store new user name and password in data\user.php (auth.php, line 186)

There is no corresponding entry in the IIS log showing a problem.

Since the permissions appear to be set correctly on the server, can you give us some guidance on what to troubleshoot to clear these problems?  Thanks!


Michael O.
Oklahoma Department of Libraries

Re: Windows Install: Test and Configuration Failures

Looks like two different problems. Let's take the second one (svManager) first.

This one looks like a permissions problem. I think the permissions on the data directory must be ok or you'd have hit problems earlier. You get a problem when svManager tries to write to svmanager\data\user.php so could you double-check the permissions on this file.

The problem with the test is rather mysterious. Obviously, the test and svManager itself are designed to be as similar as possible. I'm assuming that the test and svManager are installed on the same server. Can you think of any difference in the way you installed the test and svManager? Can you check that the directory E:\sites\dev8\svmtest\uploads\ is writeable by the web user?

jack

Jack Hardie
SimpleViewer Support Team.

Re: Windows Install: Test and Configuration Failures

Hi Jack, thanks for the response.

Alright... we've completely removed and reinstalled PHP 5.3.3 on the server, configured it and set it to fire events for the website in question.

A PHPinfo() check came back as expected.

We then uploaded the SVMtest suite.  All tests passed, -including- file upload and session writing/reading.

The actual SVManager was then uploaded to the webserver into an \SVMANAGER directory in the webspace that has the following permissions set on it:  Modify, Read & Execute, List Folder Contents, Read, Write. We've also verified that the /SVMANAGER/DATA directory and the "user.php" file have the same permissions on it as the /SVMANAGER directory.

As before, we can create galleries, unlist galleries, upload images, customize galleries... everything -except- change the login over from the default login/password combination. The following errors continue to come back:

1. Warning: file_put_contents(data\user.php) [function.file-put-contents]: failed to open stream: Permission denied (auth.php, line 184)
   
2. Warning: Unable to store new user name and password in data\user.php (auth.php, line 186)

Any ideas?

- Michael

Re: Windows Install: Test and Configuration Failures

This is strange because nothing very strange or clever is happening at that point in the code. The php file_put_contents function is used extensively throughout the app and it's not giving you problems elsewhere.

I've tried to reproduce your problem on a Windows server running PHP 5.3.3 and everything works fine.

I'm probably clutching at straws here but I'd like to test the possibility that it's some kind of weird file-locking problem. Please would you edit the file svmanager/includes/constants and locate this line at the bottom of the file:

define('FPC_LOCK', LOCK_EX);

Change this to:

define('FPC_LOCK', 0);

That's a zero of course not a letter O.

jack

Jack Hardie
SimpleViewer Support Team.

Re: Windows Install: Test and Configuration Failures

Hi Jack,

I replaced:

define('FPC_LOCK', LOCK_EX);

with....

define('FPC_LOCK', 0);

The same two errors popped again. We're so close to getting this working, I hate to give up. Any other ideas?  Is there something in the PHP.INI file I should double-check?

- Michael

Re: Windows Install: Test and Configuration Failures

Hi again Jack,

I think we've identified the problem. 

In IIS 7, a new user account called IUSR has replaced the previously used IUSR_<machinename> account. Unfortunately, you don't see that account name in the users list so there's no clue it's in play at the time of install unless you happen to notice the documentation on it.

However, you DO see an IUSR_<machinename> on the user list if you install the original FTP server that came with Win2008 Server (which we did) It requires that account and the installation of IIS6 compatibility.

Therefore, we properly set the rights on the folders and files, but used the IUSR_<machinename> account and not the IUSR account.

Running a process monitor, we discovered that it was the IUSR account that was generating a "permission denied" condition on editing the USER.PHP file. We added that account with simple Read/Write permissions to the USER.PHP file and can now edit the login/password combination.

This raises the question of how/why the other parts of SVMANAGER were working and not this part. Was the IUSR account brought into play only for the password edit process and the IUSR_<machinename> account used for everything else?

- Michael

Re: Windows Install: Test and Configuration Failures

Glad to hear you're making progress although some mystery remains.

I have a hypothesis.

Most of the time, svManager is creating its own files and directories so it would always use IUSR if that's the correct one. There are only two pre-existing files that need to be overwritten: data/galleriesprefs.txt and data/user.php. The galleriesprefs.txt file is less important, it just stores things like the preferred sort order in the galleries listing. My guess is that the permission settings on the directories were allowing the IUSR account to create new files but the settings on the existing files were blocking writes to files set up by ftp.

If I'm right then galleriesprefs.txt wasn't getting written either but that would be less noticeable. It's a side-issue but I think I'll change it for the next release so problems writing to galleriesprefs.txt generate a notice for user information.

I have thought of generating both these files from code when svManager is first installed but that gives the reverse problem to some people on shared servers who then have problems replacing the user file by ftp.

Most of our users are on Linux accounts with the same user for ftp and web so they don't need to worry about all of this.

jack

Jack Hardie
SimpleViewer Support Team.

Re: Windows Install: Test and Configuration Failures

jack wrote:

If I'm right then galleriesprefs.txt wasn't getting written either but that would be less noticeable. It's a side-issue but I think I'll change it for the next release so problems writing to galleriesprefs.txt generate a notice for user information.

...........

Most of our users are on Linux accounts with the same user for ftp and web so they don't need to worry about all of this.

jack

I didn't really look at galleriesprefs.txt as a problem, but I'm thinking your guess is probably a good one. Having an error trap that displays a message would help.  I know most folks are running on LAMP boxes, but a number of us have no choice but to run Win OS boxes because of organizational decisions.

And since there is no better gallery software than SVMANAGER and its viewers, in my opinion, we appreciate any help you can give on making it easier to install and configure on Win servers.   smile

- Michael