I have written a PHP script which updates a SVN working copy.
It works fine on my development machine (W2k3 Server)but I cannot get it to work on a production server (W2k8 Server). I’m using the latest Collabnet Subversion binaries (1.6.17).
Here’s the PHP code:
$command = 'svn update C:\inetpub\wwwroot\mysite --config-dir C:\Windows\Temp';
$response = array();
$handle = popen("$command 2>&1", 'r');
$read = '';
while( $read = fread( $handle, 20096 ) )
{
$response[] = $read;
}
pclose( $handle );
flush();
echo '<h2>Command</h2><p> ' . $command . '</p>';
echo '<h2>Response</h2><p>' . implode( '<br />', $response ) . '</p>';
When I run the same command from the command prompt it works fine. But when I run it through IIS, I get:
svn: Can’t open file ‘C:\inetpub\wwwroot\mysite.svn\lock’: Access is denied.
Presumably I need elevated permissions but I have no idea how to implement it.
I’ve tried giving the _IUSR account full control of the folder containing svn and the C:\inetpub\wwwroot\mysite.svn\ folders but it makes no difference.
Thanks
Had issues just like this with SVN and Windows Server 2008. The issue is caused by the UAC stuff that typically prevents someone from changing a file if they don’t own the file. In the case of SVN, the issue was typically that one user performed the initial checkout, creating the .svn folders and associated bits. Then a different user went to
svn upand got OS-level access issues about modifying the SVN database files.Unfortunately, the best fix we could get to was disabling UAC. Actually solved a few other problems and it really makes sense on servers. If it is running as a scheduled task then you could try “run with highest priviliges” but elevating that much makes little sense for a web app.