Articles

How to Install the PHP SVN Extension

In the examples shown, replace "5.X" with your app's PHP version (for example, "5.4"). To install a PECL extension for multiple PHP versions, repeat the PECL extension installation for each PHP version.

Subversion (SVN)

The Subversion (SVN) extension implements PHP bindings for Subversion, a version control system, allowing PHP scripts to communicate with SVN repositories and working copies without direct command line calls to the svn executable.

To install this extension, run the following commands as your server's root user:

sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install libsvn-dev
sudo pecl5.X-sp install svn

When prompted with:

Please provide the prefix of Subversion installation [autodetect] :
Please provide the prefix of the APR installation used with Subversion [autodetect] :

just press enter both times; do not type a prefix (that is, allow autodetect).

Once installed, create a configuration file for the extension and restart PHP by running the following commands as root:

sudo bash -c "echo extension=svn.so > /etc/php5.X-sp/conf.d/svn.ini"
sudo service php5.X-fpm-sp restart

Installing SVN on PHP 7

The SVN extension does not currently work with PHP 7. If you attempt to install it on PHP 7, you will encounter errors building the extension. As soon as the extension is updated to work with PHP 7, you will be able to install it.


Last updated: August 31, 2017