Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a new VPN with Ubuntu server 10.04 LTS which came with Mysql 5.1 installed, that was not supporting Barracuda file formats, so I manually installed and configured Mysql 5.6. Which works perfectly so far.

Apache2 is working well too, so far (haven't been testing it a lot but seems stable).

Only thing is that PHP5 was not recognising the module for PDO, so i removed it.

Is there a way I can MANUALLY install PHP5 or any version of PHP on Ubuntu ?

If I do apt-get install php5 it says

root@vps:/etc# sudo apt-get install php5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  php5: Depends: libapache2-mod-php5 (>= 5.3.10-1ubuntu3.8) but it is not going to         be    installed or
         libapache2-mod-php5filter (>= 5.3.10-1ubuntu3.8) but it is not going to be installed or
         php5-cgi (>= 5.3.10-1ubuntu3.8) but it is not going to be installed or
         php5-fpm (>= 5.3.10-1ubuntu3.8) but it is not installable
E: Broken packages 
share|improve this question
    
By installing newer software in an older LTS release you are negating the benefits of being on an LTS release. Why are you not installing 12.04 LTS? –  Ladadadada Dec 8 '13 at 13:45

2 Answers 2

You could use a ppa to stay up-to-date with php. I use :

https://launchpad.net/~ondrej/+archive/php5

It's now on 5.5 and also includes Apache 2.4 update. For Apache 2.2 + PHP 5.4 repository, see the bottom of the answer.

If you want use this ppa do this:

https://launchpad.net/~ondrej/+archive/php5 (click here for instructions)

sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get upgrade

If you don't have add-apt-repository binary do the following:

sudo apt-get install python-software-properties

Precautions:

Are PPA's safe to add to my system and what are some "red flags" to watch out for?

For Ubuntu 12.10 Ubuntu 12.10's official repository is updated to php 5.4. You should use the main repository package if you can. To do this, just install php5 Install php5 without enabling any PPA.

PHP 5.4 Prepackaged latest PHP 5.4 now resides in separate PPA: ppa:ondrej/php5-oldstable

share|improve this answer
    
thanks...I'm resolving my problem by re-installing my VPN software from Ubuntu 10.04 to 12.04 LTS, which has native Mysql 5.5 support (which was what I wanted) and also PHP5 with PDO installed by default. cheers and thanks all for the answers. they will be good for people looking to get manual install for PHP5. thanks again. –  Adrian Tanase Dec 8 '13 at 17:56
    
question : what does apt-get upgrade do ? I think this was the command I found in another post that crashed my VPN software (by probably reinstalling critical stuff). Am I right ? –  Adrian Tanase Dec 8 '13 at 17:57

Have you tried to download the PHP source code and compile?

get the source.

./configure --prefix=... --extra options of your choice
make
make install INSTALL_ROOT=/where_to_install

package it with ubuntu

modify httpd.conf to

LoadModule php5_module path/to/libphp5.so
share|improve this answer
    
i have tried, and in the process, following other links from stackoverflow i crashed my VPN :)) was Ubuntu 10.04 and had native support for Mysql 5.1 which i didn't like...it was my mistake anyways, one Php5 link install suggested some commands that actually were trying to upgrade my Ubuntu, and I didnt know...I now asked them to install me Ubuntu 12.04 which has native support for Mysql 5.5, which is acceptable.....but I will take all your comments into consideration for future events –  Adrian Tanase Dec 8 '13 at 17:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.