Want to say write a page can perform SVN upgrade program, the result is not as simple as I think, there are some eyebrows need to pay attention to say.
Use the Apache user account to perform SVN checkout, so that Apache has SVN's link power before it can perform SVN update via the webpage.
Su-s/bin/bash www-data /var/www svn checkout http://www.xxx.com/ Svn/my_site
Add the export LANG=C.UTF-8 Environment declaration before executing the shell command with PHP, otherwise the Error,ubuntu Apache default is lang=c if SVN update encounters Chinese.
The--accept theirs-full parameter is then added for SVN, which is the file version of SVN Server when the conflict occurs
Finally, add 2>&1 to allow PHP to get all the information that contains the error
<? PHP putenv (' lang=c.utf-8 '); Set the locale variable to resolve the problem caused by the Chinese name in svn update $resultshell_exec(' SVN update--accept theirs-full/var/ Www/my_site 2>&1 '); Echo NL2BR ($result);
Call the SVN command in PHP to update the Web site method (resolves a file name that contains a Chinese update failure problem)