Install Apache, Php, Mysql latest versions not available via apt

Solution 1:

Before to install the new versions, you should uninstall any other versions that you have installed before.

Install Apache 2.4.4

  1. Before installing Apache 2.4.4, you should install PCRE, otherwise it will not succeed. The process of installing PCRE is simple. After you downloaded it, run in terminal next commands:

    sudo ./configure
    sudo make
    sudo make install
    
  2. Download APR and APR-Util from http://apr.apache.org, unpack them to Apache directory, /srclib/apr and /srclib/apr-util (no version numbers in the directory names) and type following commands to install Apache:

    sudo ./configure --with-included-apr
    sudo make
    sudo make install
    
  3. Type following command to start Apache:

    sudo /usr/local/apache2/bin/apachectl start
    

There may be something wrongs like:

/usr/local/apache2/bin/httpd: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

Type following command to see httpd’s shared library dependencies:

ldd httpd

Found "libpcre.so.1 => not found", then type the following command to update links:

sudo ldconfig

Restart Apache and should work.

Source: http://zhuojun.info/?p=1121

Install PHP 5.4.16

  1. Download PHP 5.4.16 from http://php.net/downloads.php
  2. Check this post to see how to install a .tar.bz2 file: How to install a .tar.gz (or .tar.bz2) file?

Install MySQL 5.5.31

  1. Download MySQL 5.5.31 from http://dev.mysql.com/downloads/mysql/5.5.html. In fact, MySQL 5.5.32 is the latest version.
  2. Check this post see how to install a .rpm file: How do I install and manage RPMs?

Solution 2:

If you don't want to install the Apache 2.4 & PHP 5.5 by hand, you can find both in my PHP5 PPA.

I will add more PHP extensions and Apache 2.4 modules as people will come and ask for them.

There's also a MySQL 5.5 and MySQL 5.6 PPAs (and more).

Solution 3:

In general you are not likely to find the latest versions on any pre-built stack, since there will always be a time lag between a new version release and package releases in official repositories due to the need to "iron out" system specific dependencies and quirks.

You have three options :

  1. Download Ubuntu specific binaries of the latest version (if they exist) from the corresponding sites.
  2. Download the source code from said sites and compile locally.
  3. Wait for the version you are interested in to be included in the official repositories.

Now, unless there is a very specific option/need that is not offered/met in the available packages or you cannot wait for the vesrion to be included to the repositories, I suggest you go with the pre-build binaries.

Then again, compiling from source code is a great character building experience that will help you appreciate the hard work package maintainers do :-) You will have to resolve any package dependencies manually.

That being said, large and active projects like Apache, PHP and MySQL offer quite exhaustive documentation and how-to's for installing from source.