The Scheme’s hardware runs on a Linux/Apache/MySql/Php stack and was quite out of date. The following details how I upgraded the system and is a reference point for the next server that we have to upgrade.
Upgrade ubuntu hardy to 10.04
Issue the following commands in your shell window see http://www.simmonsconsulting.com/2009/03/08/howto-upgrade-ubuntu-lts-804-server-to-PHP-528/ and follow the prompts when requested to do so:
|
1 2 3 4 5 6 |
sudo apt-get update sudo apt-get safe-upgrade sudo apt-get dist-upgrade sudo apt-get install update-manager-core sudo do-release-upgrade sudo reboot |
Upgrade PHP
To upgrade from bundled PHP of 5.3.2 to 5.3.6: see http://www.zalexblog.com/2011/01/07/installing-PHP-5-3-3-on-ubuntu-10-04/#comment-339 and issue the following commands and answer the prompts when requested:
|
1 2 3 |
sudo add-apt-repository ppa:bjori/php5 sudo apt-get update sudo aptitude show php5 |
Which will show:
|
1 2 3 4 5 6 |
Package: php5 State: not installed Version: 5.3.6-8ubuntu0ppa4~lucid1 Priority: optional Section: php Maintainer: Hannes Magnusson.. |
Then issue:
|
1 2 |
sudo aptitude install php5 php5-cli php -v |
Which will show:
|
1 2 3 |
PHP 5.3.6-8ubuntu0ppa5~lucid1 (cli) (built: Jun 27 2011 18:35:59) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies |
To upgrade apc cache:
Check version at the shell prompt via:
|
1 |
apt-cache show php-apc | grep Version |
Install latest version by issuing the following command at the shell prompt:
|
1 |
sudo apt-get install php-apc |
Restart apache:
|
1 |
sudo /etc<wbr>/init.d/apache2 restart</wbr> |
PHP errors you might encounter
You might see this error when you run PHP -v:
|
1 |
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imagick.ini on line 1 in Unknown on line 0 |
This is a known bug with this version of Ubuntu, just edit the # to ; in the imagick.ini file (see http://www.asim.pk/2010/06/21/php-depreciated-errors-on-ubuntu-10-04-lts/ for example of others agreeing.)
Subsequent upgrade to Ubuntu Precise (12.04)
Run the commands and follow the prompts:
|
1 |
sudo do-release-upgrade |
You might see this error:
|
1 |
ImportError: No module named GnuPGInterface |
Which relates to python, a quick fix for this is to do the following:
|
1 |
cp /usr/share/pyshared/GnuPGInterface.py /usr/lib/python2.6/ |
Then issue:
|
1 |
sudo do-release-upgrade |
Follow the prompts and choose whether to keep your packages when asked, then reboot when finished.