0

I am using Ubuntu 10.04.1 LTS Server with PHP Version 5.3.2-1ubuntu4.19 Apache/2.2.14 (Ubuntu).

I login to the server via putty and want to upgrade to php 5.4. I could not find the right commands from Google.I am not expert in Linux Please help me step by step.

Hojat Taheri
  • 5,309
  • 6
  • 21
  • 26
  • 1
    http://askubuntu.com/questions/343560/update-server-php-version-to-5-4-10-via-the-command-line – Lynob Jan 16 '14 at 19:12

1 Answers1

1

It's not recommended to install a version of php that isn't provided by the default ppa's, but if you want to do it this is what you should do:

First we add a repo that contains the file we need, but as Ubuntu Server can't add repos at the default setting write the following command to be able to add repos:

sudo apt-get install python-software-properties

After that we can add the repo by typing:

sudo add-apt-repository ppa:ondrej/php5

Then we can upgrade php by typing these two commands:

sudo apt-get update
sudo apt-get upgrade

To be sure if you have the right version type:

php -v
  • I am login to the sever SSh via putty. I can not run sudo command – Manjula Roshan Jun 20 '13 at 02:26
  • If I run sudo apt-get install python-software-properties Come this message -bash: sudo: command not found – Manjula Roshan Jun 20 '13 at 02:31
  • Current php version is 5.3.2 Requires: PHP 5.3.3 for moodle 2.5 If not recommend upgrade to php5.4 what is your suggestion. Thanks for advise. – Manjula Roshan Jun 20 '13 at 02:38
  • http://serverfault.com/questions/377723/how-can-i-use-sudo-when-i-logged-in-with-a-ssh-key-in-putty As you're not using the server for anything serious just do as i said. –  Jun 20 '13 at 02:45
  • Check my result #apt-get install python-software-properties Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: apt-utils iso-codes python-apt python-gnupginterface unattended-upgrades – Manjula Roshan Jun 20 '13 at 04:51
  • Suggested packages: isoquery python-apt-dbg python-gtk2 python-vte python-apt-doc bsd-mailx The following NEW packages will be installed: apt-utils iso-codes python-apt python-gnupginterface python-software-properties unattended-upgrades 0 upgraded, 6 newly installed, 0 to remove and 54 not upgraded. Need to get 3139kB of archives. After this operation, 15.2MB of additional disk space will be used. Do you want to continue [Y/n]? y – Manjula Roshan Jun 20 '13 at 05:01
  • Err http://archive.ubuntu.com/ubuntu/ lucid-updates/main apt-utils 0.7.25.3ubuntu9.14 Temporary failure resolving 'archive.ubuntu.com' Err http://archive.ubuntu.com/ubuntu/ lucid/main iso-codes 3.12.1-1 Temporary failure resolving 'archive.ubuntu.com' Err http://archive.ubuntu.com/ubuntu/ lucid-updates/main python-apt 0.7.94.2ubuntu6.4 Temporary failure resolving 'archive.ubuntu.com' – Manjula Roshan Jun 20 '13 at 05:03
  • Err http://archive.ubuntu.com/ubuntu/ lucid/main python-gnupginterface 0.3.2-9.1 Temporary failure resolving 'archive.ubuntu.com' Err http://archive.ubuntu.com/ubuntu/ lucid-updates/main unattended-upgrades 0.55ubuntu8 Temporary failure resolving 'archive.ubuntu.com' Err http://archive.ubuntu.com/ubuntu/ lucid-security/main python-software-properties 0.75.10.3 Temporary failure resolving 'archive.ubuntu.com' Err http://archive.ubuntu.com/ubuntu/ lucid-updates/main python-software-properties 0.75.10.3 – Manjula Roshan Jun 20 '13 at 05:04
  • Temporary failure resolving 'archive.ubuntu.com' – Manjula Roshan Jun 20 '13 at 05:05
  • Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt-utils_0.7.25.3ubuntu9.14_i386.deb Temporary failure resolving 'archive.ubuntu.com' – Manjula Roshan Jun 20 '13 at 05:05
  • Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/i/iso-codes/iso-codes_3.12.1-1_all.deb Temporary failure resolving 'archive.ubuntu.com' Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/python-apt/python-apt_0.7.94.2ubuntu6.4_i386.deb Temporary failure resolving 'archive.ubuntu.com' Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/gnupginterface/python-gnupginterface_0.3.2-9.1_all.deb Temporary failure resolving 'archive.ubuntu.com' – Manjula Roshan Jun 20 '13 at 05:05
  • Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/u/unattended-upgrades/unattended-upgrades_0.55ubuntu8_all.deb Temporary failure resolving 'archive.ubuntu.com' Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/software-properties/python-software-properties_0.75.10.3_all.deb Temporary failure resolving 'archive.ubuntu.com' E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? root@moodle /# – Manjula Roshan Jun 20 '13 at 05:06
  • Sorry. result I can not put with
    tag. And comment field has character limitation. Then I put my result like above.
    – Manjula Roshan Jun 20 '13 at 05:13
  • I don't have enough Ubuntu Server experience to help you at this point. Try to connect to the "#ubuntu-server" channel on "irc.freenode.net" and ask for help. –  Jun 20 '13 at 11:30