ServerGrove PHP Installation on a VPS

ServerGrove’s VPS services come with a special installation of PHP that includes most of the common extensions. By creating this special installation, we can ensure our customers that we provide the latest stable versions and that updating them is as easy as running the CentOS, Ubuntu or Debian updater.

PHP is installed in:

  • /usr/local/php55
  • /usr/local/php54
  • /usr/local/php53
  • /usr/local/php52

For PHP 5.5, 5.4, 5.3 and 5.2 respectively. This allows customer to have several versions of PHP installed at the same time in case they need it. Below replace php53 with the version you are using.

Paths

  • Binaries: /usr/local/php53/bin
  • Configuration file (php.ini): /usr/local/php53/lib/php.ini
  • Extensions: /usr/local/php53/lib/php/extensions/no-debug-non-zts-20090626
  • Extensions configuration files: /etc/php53/conf.d
  • Your custom configuration file: /etc/php53/conf.d/zzz_custom.ini

We recommend that you add any custom PHP directives in a file named /etc/php53/conf.d/zzz_custom.ini, as this will ensure that your settings overwrite the defaults. Do not change php.ini or other conf.d files, as we may overwrite these when upgrading PHP.

Upgrading PHP

To upgrade PHP from a minor version to another (e.g 5.4.1 to 5.4.2), run the upgrade command in your server:

On Ubuntu and Debian

apt-get update && apt-get upgrade

On CentOS

Extensions

If you need to add an extension, it is possible that it is already included in our repository. The name format will be php53-extension. To search for an extension, run the following commands:

Ubuntu and Debian

CentOS

If an extension is not in the repository, try installing with pecl, phpize, from source, or contact us to see if we can add it to the repository. We welcome suggestions!

Changing PHP versions

If you no longer need the current version of PHP you’re using (e.g PHP 5.4) and you would like to update to a more recent (or older) version of PHP, it’s really easy to do.

  1. Remove the main PHP package: apt-get remove php54 or yum remove php54 — this will delete the PHP package and all the related extensions
  2. Install the new main PHP package: apt-get install php55 or yum install php55
  3. If you’re using Apache, make sure you install the PHP Apache module: apt-get install php55-mod-php or yum install php55-mod_php — Apache will automatically restart, but if it doesn’t, you can issue an service apache2 restart or service httpd restart if in CentOS
  4. Install any other extension you might be missing, and you’re done!