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:
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.
- 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.
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
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
apt-cache search php53-*
apt-get install php53-mongo
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.
- Remove the main PHP package:
apt-get remove php54or
yum remove php54— this will delete the PHP package and all the related extensions
- Install the new main PHP package:
apt-get install php55or
yum install php55
- If you’re using Apache, make sure you install the PHP Apache module:
apt-get install php55-mod-phpor
yum install php55-mod_php— Apache will automatically restart, but if it doesn’t, you can issue an
service apache2 restartor
service httpd restartif in CentOS
- Install any other extension you might be missing, and you’re done!