Jump to content

Recommended Posts

Hello All

 

    I'm not sure if this is the correct place to post this, but it seemed the best option out of the other choices on this forum. I have decided that I would start to use Subversion to control my PHP projects (instead of my home-grown version control), and I would like some assistance please. I have never used Subversion before but my co-workers cannot say enough good things about it. I have been doing some reading about how to set-up and use Subversion but I have been confused by some things. Whenever I read a "how to" talk about setting up a repository they always start out in "/home/username". The only problem is that PHP will not run from that location; as we all know, it must run from "/var/www/html". So I guess my question is can I set up a repository in "/var/www/html" instead of my home directory? Also, what about the fact that I already have many PHP projects in the web root? Will SVN overwrite or duplicate any of the code that is already there when I create the new repository?

 

As I am a complete newbie at this, any and all assistance will be appreciated. Thanks, and have a great day.  :)

Link to comment
https://forums.phpfreaks.com/topic/192748-subversion-assistance-needed/
Share on other sites

When working with SVN you need to distinguish two things:

SVN repository - this is where SVN keeps information about versioned files. This can be stored literally anywhere you wish, as long as you can access it from your computer.

Working copy directory - this is where you do your work (probably in your web root in this case). To get latest copy of versioned files from repository, you need to do a 'checkout' to this folder.

 

For more details see: http://svnbook.red-bean.com/

  • 2 weeks later...
as we all know, it must run from "/var/www/html"

PHP runs wherever you tell it to.  You'd want to read the Apache documentation to see how to configure it to run from elsewhere or how to set up each virtual host to come from a different document_root.

Here's a good way to set up Subversion.

 

Subversion Repository:  This is your main storage of files, where the master copies are stored.  All versions and final copies are here.  If you add another programmer to your team, he will need to grab the files from here and put it into a spot where he can code it (his working directory).  The repository is used for storage, therefore it does not have to be in the public_html or www directory where PHP is run from.

 

Working Directory:  This is the location where you'll have your local copy of the code.  For example, this may be your computer on a spot where you can run PHP from.  This is the spot where you'll do your coding from.

 

Production Server:  This is the remote server where your site goes live.

 

 

First, create repository.  This can be anywhere.  If the files need to be shared, then it needs to be in a spot where the users can access it.  In my own home, I set the respository in an external hard drive since I am the only developer.  In a typical scenario, you'd put it in a server where all your coworkers can access it.  Next, create the working directory on your local computer where you can run PHP locally.  If the repository already has files, then you'll want to get the files from the repository into the working directory using a series of Subversion commands.  When you're done making code changes, you'll want to 'commit' to the repository, which will send your updates to it.  When the code in your repository is stable, then you can go into the production server and download the files from the repository (svn update).

 

You'll see here that your working directory and the production server are the places that need to run PHP, not the repository.

  • 2 weeks later...

Where you have your subversion really doesn't matter as long as it's on a supported os.

[http://svnbook.red-bean.com/en/1.5/svn.intro.quickstart.html]

 

How you access subversion depends upon where you keep it though. It's a good idea to have subversion on it's own box with a solid backup plan in place. Placing it on your web server for either development or production level applications / sites is a risk you shouldn't take if you don't need to.

 

Do you need to provide web access to subversion? that would also limit where you can place subversion.

 

Once you have subversion set up, be sure to create a standard convention for your files in there. Getting that hashed out before you start adding your sites / applications to the repos is a good idea.

 

Good luck

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.