[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: problem in running svn command through php on CentOS

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-12-26 06:46:01 CET

On Dec 25, 2007, at 23:34, Ryan Schmidt wrote:

> On Dec 25, 2007, at 23:27, pinky goyal wrote:
>
>> On 12/20/07, Ryan Schmidt wrote:
>>
>>> <?php
>>> $cmd = '/usr/bin/svn list file:///var/subversion/devfoundry/ 2>&1';
>>> exec($cmd, $output);
>>> $output = implode("\n", $output) . "\n";
>>> echo $output;
>>> ?>
>>
>> thnx for the reply.
>>
>> i have tried this and now what error i am getting is.
>>
>> svn:can't open file '/root/.subversion/servers':permission denied
>>
>> i have tried after giving rights to the file also, but even than i
>> am getting the same error.
>
> I figured it would be some error like that. The svn command needs
> to read data out of the .subversion directory in the current user's
> home directory. When running under your web server, it thinks /root
> is its home, but your web server is not running as root; it's
> probably running as www or apache or nobody. Those users probably
> don't have permission to read things in /root. One option might be
> to tell the svn command where its home is, e.g.
>
> <?php
> $cmd = 'HOME=/some/place /usr/bin/svn list file:///var/subversion/
> devfoundry/ 2>&1';
> ?>
>
> where /some/place is a directory the web server user can read and
> write, so that svn can create the .subversion directory there.

I forgot svn offers a more direct switch you can use:

<?php
$cmd = '/usr/bin/svn list --config-dir /some/place file:///var/
subversion/devfoundry/ 2>&1';
?>

That would be better.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Dec 26 06:52:08 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.