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

Re: is there any web script to execute "svn checkout" via web without accessing via shell?

From: matt farey <matt.farey_at_gmail.com>
Date: 2007-03-14 16:27:55 CET

Hi.
> Using SVN version 1.4.2 (r22196) on Linux, I'm trying to create a webpage to
> do a "svn checkout" of a project from the SVN repository to the web
> directory (both are on the same machine).
>
> I want to execute:
> svn --username john --password foo co http://svn.mydomain.com/project via
> web in order to update the public project without accessing server via
> shell.
>
> I created this PHP script (perhaps most of you aren't keen on PHP):
> -------
> chdir('/home/www');
> $command = "svn --username john --password foo co
> http://svn.mydomain.com/project"; echo "<li>$command ...\n"; echo "<pre>" .
> shell_exec($command) . "</pre>\n"; echo "<li> ... Executed\n";
> ----------
> but doesn't work. It shows "Executed", but checkout wasn't made and standard
> output is not shown.
>
> Does anybody know any smart way to execute a "svn checkout" via web?
> Thank you very much.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
>
What was the return from the shell_exec, there will perhaps be problems
with paths (some env vars like home etc...) so try to use absolute paths,
also even when you do this you might encounter internal paths that arent
set properly.
Also does the user your server is running under have rights you need, do
you run SeLinux?
try to use passthru or system so you get access to stout and sterr when
you use php to execute the command
and/or use &2>1 at the end of your command to makes ure you get al the
return.
also make sure your machine will honour DNS lookups, using the hostname
isnt as reliable as IP if you can use IP from the webserver.

-- 
Matthew Farey
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Mar 14 16:28:38 2007

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