header("Cache-Control:no-cache,must-revalidate");$handle = popen('svn --version','r'); $read = stream_get_contents($handle);echo "";printf($read);echo "
"; pclose($handle);
Code source Zhang Banquet N years ago Blog: http://blog.s135.com/post/371/2/1/
So that the result of accessing the output on the browser ok
SVN, version 1.6.11 (r934486) compiled APR, 16:13:51
Copyright (C) 2000-2009 CollabNet. Subversion is open source software,
See Http://subversion.tigris.org/This product includes software
developed by CollabNet (http://www.Collab.Net/).
The following repository access (RA) modules is available:
- Ra_neon:module for accessing a repository via WebDAV protocol using neon.
- handles ' http ' scheme
- handles ' https ' scheme
- Ra_svn:module for accessing a repository using the SVN network protocol.
- with Cyrus SASL authentication
- handles ' svn ' scheme
- ra_l Ocal:module for accessing a repository on local disk.
Replace the second line of code with
popen('svn up --username zmk --password 123456 /home/wwwroot/test/','r');
(Nothing is output).
If you replace the second line of code with
popen('svn up --username zmk --password 123456 /home/wwwroot/xxx/','r');
Here /home/wwwroot/xxx
is the wrong address, the final page will be output
Skipped '/home/wwwroot/xxx'
Ask the god of Linux to see
Now the user groups and users of this script are www:www
Reply content:
header("Cache-Control:no-cache,must-revalidate");$handle = popen('svn --version','r'); $read = stream_get_contents($handle);echo "";printf($read);echo "
"; pclose($handle);
Code source Zhang Banquet N years ago Blog: http://blog.s135.com/post/371/2/1/
So that the result of accessing the output on the browser ok
SVN, version 1.6.11 (r934486) compiled APR, 16:13:51
Copyright (C) 2000-2009 CollabNet. Subversion is open source software,
See Http://subversion.tigris.org/This product includes software
developed by CollabNet (http://www.Collab.Net/).
The following repository access (RA) modules is available:
- Ra_neon:module for accessing a repository via WebDAV protocol using neon.
- handles ' http ' scheme
- handles ' https ' scheme
- Ra_svn:module for accessing a repository using the SVN network protocol.
- with Cyrus SASL authentication
- handles ' svn ' scheme
- ra_l Ocal:module for accessing a repository on local disk.
Replace the second line of code with
popen('svn up --username zmk --password 123456 /home/wwwroot/test/','r');
(Nothing is output).
If you replace the second line of code with
popen('svn up --username zmk --password 123456 /home/wwwroot/xxx/','r');
Here /home/wwwroot/xxx
is the wrong address, the final page will be output
Skipped '/home/wwwroot/xxx'
Ask the god of Linux to see
Now the user groups and users of this script are www:www
Refer to the code in the PHP manual to see where the problem lies.
In the following also ask oneself answer, here is no longer paste copy, direct link address bar.
Hope to be helpful to other friends who meet the same problem!
Http://stackoverflow.com/questions/21870660/access-a-phpscript-through-the-browser-to-execute-the-function-of-popen-som