4

I've got a command I've created that makes an info call to an SVN repository stored on hosted SVN service. Here's an example:

exec('svn info https://myrepo.svn.beanstalkapp.com/project/name/folder 2>&1', $output, $returnStatus);
if ($returnStatus)
{
    print_r($output);
}

The response I get is:

Array
(
    [0] => Authentication realm:  SVN
    [1] => Password for 'apache': Authentication realm:  SVN
    [2] => Username: svn: PROPFIND request failed on '/project/name/folder'
    [3] => svn: PROPFIND of '/project/name/folder': authorization failed (https://myrepo.svn.beanstalkapp.com)
)

I'm running the script on a box that has Plesk on it. It runs final locally so I suspect it's a configuration issue (which I can't seem to find any answers for online).

I don't know how to make the apache user be able to access the authentication realm - I believes that's the issue at hand.

3
  • It seems to use basic auth over https. So it might be sufficient to use svn --password ... --username ... for running the request. Commented Aug 10, 2011 at 15:55
  • I still throws that error. The exact command I'm using is svn info --username myuser --password pass myrepo.svn.beanstalkapp.com/project/name/folder 2>&1 - gives the same error. :-( Commented Aug 12, 2011 at 0:04
  • 1
    Can you also add --no-auth-cache --non-interactive options for testing? That might be relevant in your case. Otherwise try to set $HOME and $USER to the account you successfully executed svn info with. Or as last resort configure sudo to perform any interaction under that account - instead of the apache user (might run in a sandbox/jail/selinux/etc?). Commented Aug 14, 2011 at 4:36

1 Answer 1

2

You need to provide the login credentials - --username and --password ( or make sure that the credentials are stored in ~/.subversion for the user running the app)

And why don't you use some client library like phpsvnclient - http://code.google.com/p/phpsvnclient/

Sign up to request clarification or add additional context in comments.

2 Comments

I would use the phpsvnclient, but it isn't very friendly or doesn't seem well supported. I was actually passing in the username and password via the URL ie. username:password@http://myrepourl.beanstalkapp.com - it still throw that error...I think it's a configuration error or something...maybe the Apache user doesn't have permission to access that "realm"?
David D. - Did you try it as svn info --username <username> --password <password> https://myrepo.svn.beanstalkapp.com/project/name/folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.