0

I purchased a new VPS from bluehost they provided me old version of PHP that's not supporting my website and Its been 1 Week bluehost technical support team refused to do that they are making excuses.

My ubuntu version is 12.04.5 LTS

I want to update Apache,MySQL and PHP with their latest version and all dependencies and necessary extensions that are commonly used on website.

I know that some people think that my Question is duplicate of other questions.

I am asking that what I have to do for upgrading Apache, MySQL and PHP for example: I have to remove all these three before upgrading on server ?

My problem is how can i upgrade Apache, MySQL and PHP???

Please explain step by step

1 Answers1

0

Before you begin, you should know that ppas are not officially supported. ppas are provided by members of the community. As mentioned here, you should visit this link before you begin.

Although, it should be noted that this particular ppa is used by many people, if you Google "php5 ppa" you will see many tutorials reference this.

To install the newer versions and to add the ppa for php version 5.6 and mysql 5.6 and the newer version of apache as well, run the following commands and please post any errors:

sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo add-apt-repository ppa:ondrej/mysql-5.6
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5

For more info: visit here for info on the php5 ppa and a list of the packages added by the ppa

Also: visit here for more info on the mysql ppa and a full list of the added packages

mchid
  • 42,315
  • 7
  • 94
  • 147
  • what about apache – Arun Pratap Singh Oct 21 '15 at 03:43
  • latest version of apache is 2.4 – Arun Pratap Singh Oct 21 '15 at 03:44
  • I believe it is provided by the php5 ppa https://launchpad.net/~ondrej/+archive/ubuntu/php5-5.6/+index?batch=75 – mchid Oct 21 '15 at 03:56
  • @shawn_parker then you need to run `sudo apt-get install python-software-properties` first – mchid Oct 21 '15 at 04:02
  • When i run this command from ssh as root user `sudo add-apt-repository ppa:ondrej/php5-5.6` or `add-apt-repository ppa:ondrej/php5-5.6` its giving me error -bash: add-apt-repository: command not found – Arun Pratap Singh Oct 21 '15 at 04:02
  • I am currently installing python-software-properties. – Arun Pratap Singh Oct 21 '15 at 04:08
  • updation process has started. – Arun Pratap Singh Oct 21 '15 at 04:16
  • 1
    I know that bro ... – Arun Pratap Singh Oct 21 '15 at 04:20
  • Problem occur bro – Arun Pratap Singh Oct 21 '15 at 04:22
  • when i run this command: `sudo apt-get upgrade` its giving me this output: – Arun Pratap Singh Oct 21 '15 at 04:23
  • `Reading package lists... Done Building dependency tree Reading state information... Done The following packages have been kept back: apache2 libapache2-mod-php5 libjson0:i386 mysql-server openssl php5-cgi php5-cli php5-common php5-curl php5-gd php5-imap php5-mcrypt php5-mysql php5-sqlite php5-xsl 0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.` – Arun Pratap Singh Oct 21 '15 at 04:23
  • @shawn_parker You can run `sudo apt-get install apache2 libapache2-mod-php5 libjson0:i386 mysql-server openssl php5-cgi php5-cli php5-common php5-curl php5-gd php5-imap php5-mcrypt php5-mysql php5-sqlite php5-xsl` to upgrade that stuff. – mchid Oct 21 '15 at 04:26
  • after this output, I run this command `sudo apt-get install php5` then its give long output but i giving you last few lines – Arun Pratap Singh Oct 21 '15 at 04:26
  • `12 upgraded, 11 newly installed, 4 to remove and 3 not upgraded. Need to get 14.3 MB of archives. After this operation, 4931 kB of additional disk space will be used. Do you want to continue [Y/n]? y ` – Arun Pratap Singh Oct 21 '15 at 04:26
  • after pressing `y` it's give me long output but i am giving you last few lines – Arun Pratap Singh Oct 21 '15 at 04:28
  • what you r saying bro?? – Arun Pratap Singh Oct 21 '15 at 04:29
  • after running this command `sudo apt-get upgrade` it asked me to do you want to keep the old version of software, I pressed n – Arun Pratap Singh Oct 21 '15 at 04:32
  • after that suddenly it stopped – Arun Pratap Singh Oct 21 '15 at 04:32
  • i restarted my vps server and run all the commands but it didn't asked me do you want to keep old software – Arun Pratap Singh Oct 21 '15 at 04:33
  • When i pressed **n** it did not did any process – Arun Pratap Singh Oct 21 '15 at 04:35
  • bro should i install teamviewer or somekind of window sharing software – Arun Pratap Singh Oct 21 '15 at 04:36
  • i check that it did not uninstall any software – Arun Pratap Singh Oct 21 '15 at 04:39
  • first time i run **apt-get upgrade** it asked me do you want to keep old software then i pressed **n** it did some process but it didn't uninstall any software – Arun Pratap Singh Oct 21 '15 at 04:41
  • now when i run **apt-get upgrade** its giving me this output: – Arun Pratap Singh Oct 21 '15 at 04:42
  • `Reading package lists... Done Building dependency tree Reading state information... Done The following packages have been kept back: apache2 libapache2-mod-php5 libjson0:i386 mysql-server openssl php5-cgi php5-cli php5-common php5-curl php5-gd php5-imap php5-mcrypt php5-mysql php5-sqlite php5-xsl 0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.` – Arun Pratap Singh Oct 21 '15 at 04:42
  • only first it asked do you want to keep old software... now its not asking – Arun Pratap Singh Oct 21 '15 at 04:44
  • **apt-get-install php5** `12 upgraded, 11 newly installed, 4 to remove and 3 not upgraded. Need to get 14.3 MB of archives. After this operation, 4931 kB of additional disk space will be used. Do you want to continue [Y/n]? y` – Arun Pratap Singh Oct 21 '15 at 04:44
  • what packages are listed to remove – mchid Oct 21 '15 at 04:45
  • after pressing **y** its stopped with some errors on the bottom : – Arun Pratap Singh Oct 21 '15 at 04:45
  • `dpkg: error processing /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb (--unpack): trying to overwrite '/usr/share/man/man8/apache2.8.gz', which is also in package apache2.2-common 2.2.22-1ubuntu1.10 dpkg-deb (subprocess): subprocess data was killed by signal (Broken pipe) dpkg-deb: error: subprocess returned error exit status 2 Processing triggers for man-db ... Errors were encountered while processing: /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) ` – Arun Pratap Singh Oct 21 '15 at 04:45
  • bro currently i am talking to **bluehost** support – Arun Pratap Singh Oct 21 '15 at 04:49
  • then run `apt-get remove apache2.2-common` however, don't press y if it says it will remove a bunch of packages. If it only lists one or two packages to remove, then press **y** – mchid Oct 21 '15 at 04:50
  • You wanted version 2.4 anyhow and you can't have 2.2 and 2.4 installed on the same system. – mchid Oct 21 '15 at 04:51
  • bro wait lets check what **bluehost** technical team says. – Arun Pratap Singh Oct 21 '15 at 04:53
  • r u there???????????????? – Arun Pratap Singh Oct 21 '15 at 04:56
  • @shawn_parker yep, what's up? – mchid Oct 21 '15 at 04:58
  • **bluehost** support team saying our technical team will do that... i don't know when they do – Arun Pratap Singh Oct 21 '15 at 05:00
  • what should i do now ??? – Arun Pratap Singh Oct 21 '15 at 05:00
  • @shawn_parker you just need to uninstall or remove apache2.2-common before you can install php5. After you run: `apt-get remove apache2.2-common` you can run `apt-get install php5` and you should not see the same error. – mchid Oct 21 '15 at 05:01
  • Ok bro .. i am starting again whole process from beginning – Arun Pratap Singh Oct 21 '15 at 05:02
  • You still need to remove `apache2.2-common` – mchid Oct 21 '15 at 05:03
  • yes i will remove apache2.2-common – Arun Pratap Singh Oct 21 '15 at 05:04
  • bro when i run this command `apt-get remove apache2.2-common` its giving me same error just i mentioned abvoe – Arun Pratap Singh Oct 21 '15 at 05:08
  • `dpkg: error processing /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb (--unpack): trying to overwrite '/usr/share/man/man8/apache2.8.gz', which is also in package apache2.2-common 2.2.22-1ubuntu1.10 dpkg-deb (subprocess): subprocess data was killed by signal (Broken pipe) dpkg-deb: error: subprocess returned error exit status 2 Processing triggers for man-db ... Errors were encountered while processing: /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) ` – Arun Pratap Singh Oct 21 '15 at 05:09
  • @shawn_parker okay, run `apt-get clean` and then: `dpkg -r apache2.2-common` then run: `apt-get update` and finally: `apt-get install php5` – mchid Oct 21 '15 at 05:43
  • @shawn_parker you see, when apt-get doesn't work, we can use dpkg to remove apache2.2common instead. Once that is done, you should be able to proceed without error. – mchid Oct 21 '15 at 06:24
  • when i run `dpkg -r apache2.2-common` it give me this output – Arun Pratap Singh Oct 21 '15 at 06:51
  • `dpkg: dependency problems prevent removal of apache2.2-common: libapache2-mod-php5 depends on apache2.2-common. apache2 depends on apache2.2-common (= 2.2.22-1ubuntu1.10); however: Package apache2.2-common is to be removed. apache2-mpm-prefork depends on apache2.2-common (= 2.2.22-1ubuntu1.10). libapache2-mod-python depends on apache2.2-common. dpkg: error processing apache2.2-common (--remove): dependency problems - not removing Errors were encountered while processing: apache2.2-common ` – Arun Pratap Singh Oct 21 '15 at 06:52
  • @shawn_parker okay, run: `dpkg -r libapache2-mod-php5` then: `dpkg -r apache2-mpm-prefork` and: `dpkg -r libapache2-mod-python` and finally: `dpkg -r apache2.2-common` – mchid Oct 21 '15 at 06:57
  • bro finally **bluehost** technical team doing upgradation........ – Arun Pratap Singh Oct 21 '15 at 07:15
  • 1
    if its get updated i will tell you and then i will accept your answer as solution – Arun Pratap Singh Oct 21 '15 at 07:17
  • you just about had it, it's messy but there is light at the end of the tunnel. – mchid Oct 21 '15 at 07:19
  • 1
    yeah bro.. I want to say that I never met a person like you, you are so kind.. Thanking you sooo muchhh for giving me your precious time bro – Arun Pratap Singh Oct 21 '15 at 07:22