|Subversion Deprecated; See Git|
This page provides instructions for installing CiviCRM from Subversion. Subversion is now deprecated. Source code is now managed through git. For more directions, see Contributing to CiviCRM using GitHub.
NOTE: You need PHP5 installed and working (note also you must have php-xml installed if your distribution does not include DOMXML support in the mail PHP executable, as is the case in Fedora). If you are using a Mac and don't want to compile your own PHP build, download and install the latest version of MAMP (Mark Liyanage's PHP/Apache set does not include SOAP support).
This document is primarily for developers who want to install and run code directly from subversion.
1) Start with a working CiviCRM install on your server/localhost. If you do not currently have CiviCRM installed, download the latest tarball and run the installer.
2) Usually the installer will have installed CiviCRM with the permissions of the webserver, in particular the folders used for template compilation usually under <site_root>/sites/default/files/civicrm. The OS user that you are logged in as for the next steps will need write access to those folders. In a development environment you don't have to worry about security so you can just do something like `chmod -R 777 <site_root>/sites/default/files/civicrm`.
3) Check out CiviCRM from the repository to update the code in your civicrm install with the following commands
You can also do it the slightly harder way and install manually .
Make sure you are picking up the right svn version. The example above picks up the 'trunk' directory which is the current development version. For a branch version you would replace 'trunk' with the branch directory (e.g. for v3.4 use http://svn.civicrm.org/civicrm/branches/v3.4). To see a list of all currently available branches go to: http://svn.civicrm.org/civicrm/branches.
Note: all CiviCRM releases are checked into a branch, and then merged into trunk. So if you are making changes to 3.4 / 4.0, you should check in to branches/v3.4, and that will be merged into trunk. If you need to worry about the different between the CMS versions, i.e. you need different code in the 3.4 and 4.0 branches, then you should check the relevant code into each branch separately.
Note: If you are installing a 4.x version with Drupal 6, you will also need to do the steps near the bottom of distmaker/dists/drupal6_php5.sh, where it replaces the drupal folder with the version from 3.4.
|Using release tags in an SVN installation|
If you want to maintain the data in this installation through one or more release cycles, then consider checking out tagged releases rather than checking out the latest revision from a branch. This is particularly useful if you are working with a copy of production data from a stable release over the course of an alpha / beta new release cycle. Learn more
For the scenario where you do want to be running off a branch, but temporarily switch to the tagged release with the intention of switching back to the branch, it can be achieved with "svn switch" but it may be more efficient to download the tarball release, take a peek in civicrm-version.txt to get the revision number, and then do "svn update -r <revision>"
|Keeping your SVN install up to date|
If you are running a version of CiviCRM that is under active development there will be periodic (possibly frequent) changes in the schema / database objects. An easy way to update your schema and the automatically created DAO files is to run the provided setup.sh shell script whenever you notice schema changes in svn updates (anytime a file in xml/schema is updated - you've gotten some kind of schema change). The script will generate a fresh copy of all the DAO's (running GenCode.php) as well as sql/civicrm.mysql and sql/civicrm_data.mysql - and then drop / rebuild your database.
If this is an svn install from scratch and you decided to skip step 1 installing from a tarball first, then as of CiviCRM 4.3 note that setup.sh will fail at the end because it requires the civicrm module to be enabled already. Your installation may still work, but some features that depend on triggers or stored procedures may not.
Configure setup.sh (for CiviCRM < v4.3)
- $ cp bin/setup.sh.txt bin/setup.sh
- edit setup.sh - adding the correct values for DBNAME, DBUSER and DBPASS (for your CiviCRM database)
- make sure setup.sh has execute permissions
Configure setup.conf (for CiviCRM >= v4.3)
- $ cp bin/setup.conf.txt bin/setup.conf
- edit setup.conf - adding the correct values for DBNAME, DBUSER and DBPASS (for your CiviCRM database)
- make sure setup.sh has execute permissions
|setup.sh on Windows|
You can't use setup.sh on Windows. You will need to manually run the commands as described in the document at the link above installing manually, but start down at step 6 there.