← ServerPilot Docs

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.

Uninstalling the SVN Extension

To uninstall this extension, as root run the commands:

sudo rm /etc/phpX.Y-sp/conf.d/svn.ini
sudo peclX.Y-sp uninstall svn

Next, restart PHP-FPM with the command:

sudo service phpX.Y-fpm-sp restart
Last updated: February 26, 2018

Launch your first site in 5 minutes