Access the PHP script by opening the URL to execute the SVN update by executing the Popen () function

Source: Internet
Author: User
Tags svn update collabnet
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.

    • handles ' file ' scheme

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.

    • handles ' file ' scheme

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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.