1

I want to visit a url via http://xxxxx.php then my server will update automatically

I try to many way to use php execute "svn update" on my server Like:

system('./svn.sh', $retval);   //svn.sh contain svn up ....
system('svn up .', $retval);
system('/usr/bin/svn up --username xxx --password --- /my_path', $retval);

PS :I don not want to use third party php extension for subversion Thanks !!!

2 Answers 2

3

I wouldn't use php for this type of task. Rather I would use ssh to publish from the localhost to the remote host to bring that server up to date

ssh my_user@my_host.com "/usr/bin/svn up /my_path"

This is more secure and more suited for a system level task.

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

1 Comment

Genius! Thanks a lot. Your method is much better.
1

Did you test permissions on /my_path ? it has to be writeable by your webserver user. Additionally, you can use exec instead of system which also returns every line of output.

exec('/usr/bin/svn up --username xxx --password --- /my_path', $output, $retval);
print_r($output);

The above will give you hints where it fails

1 Comment

my problem is I used root execute svn co before. Now I can not change '.svn' floders permissions . Thanks!!

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.