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.

Is there an easy way out to get the latest PHP? I have tried updating my package but none of it has 5.4.6 yet.. if anyone knows on how to do it quickly, can it be shared here?

I've tried compiling from the source, but I am constantly getting:

 configure: error: Cannot find OpenSSL's <evp.h>.

In my ./configure I've specified where evp.h is, --with-openssl=/usr/include/openssl \.., but still it gives me, that error

share|improve this question

migrated from stackoverflow.com Aug 23 '12 at 5:00

This question came from our site for professional and enthusiast programmers.

add comment

4 Answers

up vote 56 down vote accepted

Installing PHP 5.4.* on Ubuntu 12.04
Simply add the PPA repository:

sudo add-apt-repository ppa:ondrej/php5-oldstable

And install it:

sudo apt-get update
sudo apt-get install php5

NB! For latest version of PHP (currently 5.5.1) add the PPA repository:

sudo add-apt-repository ppa:ondrej/php5
share|improve this answer
    
seems like this is not the latest 5.4.6? –  user79356 Aug 22 '12 at 9:42
3  
wow....that worked!!! –  Nitin Bansal Apr 2 '13 at 7:06
5  
Ubuntu 10.04 LTS: sudo: add-apt-repository: command not found –  Hubro May 29 '13 at 9:52
5  
@Codemonkey and future people with same problem, you can run apt-get install python-software-properties to be able to use add-apt-repository –  Moak Jun 5 '13 at 3:11
4  
@Moak or they just use the correct program name: apt-add-repository which is pre-installed in current Ubuntu ditributions –  feeela Sep 18 '13 at 9:46
show 3 more comments

If the official Ubuntu repositories aren't updated (and I do not think they are yet, latest PHP version available should be 5.3.x), you'll have to download the source files and compile it yourself.

See: http://www.php.net/manual/en/install.unix.php

share|improve this answer
    
I actually tried that and got stuck with this error: configure: error: Cannot find OpenSSL's <evp.h>. In my configure I've specified where evp.h is is, --with-openssl=/usr/include/openssl \.. but still it gives me that error –  user79356 Aug 22 '12 at 9:26
    
I'm sorry, I've never tried to manually build the php sources under linux. If it is not urgent, I'd recommend to wait for the official package to be updated, I do not think it'll take much longer. EDIT: try installing openssl-devel as suggested here: webhostingtalk.com/showthread.php?t=184406 –  Matteo Tassinari Aug 22 '12 at 9:29
    
@adit Always when you see something like "Cannot find foo.x", try ubuntus package search packages.ubuntu.com –  KingCrunch Aug 22 '12 at 9:58
add comment

Hai Look at the following page to update PHP 5.4 in Ubunthu

http://www.zimbio.com/Ubuntu+Linux/articles/D_AsJR2qAL6/How+Upgrade+PHP+5+4+Ubuntu

You can update by apt-get command in terminal. Open Terminal and login to su user . then try the following command to update

add-apt-repository ppa:ondrej/php5
apt-get update
apt-get install php5

If you try in local user means, use sudo before all commands...

WARNING: - this will also auto-upgrade Apache (now 2.4) which has additional consequences, i.e. there are big config changes between Apache 2.2. and 2.4 that will prevent the Apache service from running afterwards!

share|improve this answer
add comment

I had a same problem, after updating the localhost shows me the following error.

Forbidden You don't have permission to access /phpmyadmin/index.php on this server. Apache/2.4.6 (Ubuntu) Server at localhost Port 80

my /etc/apache2/000-default.config was like this

<Directory /home/......./web>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

I edited to this and it works for me.

<Directory /home/......./web>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
share|improve this answer
add comment

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.