Considerations for running PHP Update server code with SVN hooks

Source: Internet
Author: User

Want to submit code locally to the SVN server while synchronizing the code of the test server

PHP files that run the server using SVN hooks

The code is as follows:

<?PHPHeader("content-type:text/html; Charset=utf-8 ");Header("Cache-control:no-cache,must-revalidate");$username= ' User name '; $password= ' Password '; $target _dir= ' path '; exec("Sudo svn up--username$username--password$password $target _dir2>&1 ",$output); Print_r($output);?>

Precautions

1. The path of the PHP file must have write permission, the simplest is set to 777

2. Reference http://aben328.iteye.com/blog/1070850

An error occurred before the can ' t open file Permission denied

Using the ll file path/.SVN, the user is found to be root

You can use the Chown–r apache:apache file path

Modify

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.