Upgrading php from php 5.3 to 5.4 .7
- by Takingsides
So, quickly so to speak I have noticed this topic around, I have searched and there are plenty of solutions. However these solutions do not work for me, not only that but I'm intending to learn more about the Debian based OS.
Questions
I would like to know how to upgrade php5.3 to php 5.4.7 compiling it from source, myself without using a third-party ppa.
Is the way (explained below) the correct way of configuring php5.4? I'm new to compiling from source.
Set-up
I run Ubuntu Server 12.04 64bit. I've currently got:
PHP 5.3
MySQL-Server
Apache2
Memcached
The Problem
So I initially installed php5.3 using apt-get. I now wish to upgrade the php 5.4 due to the advantage of traits in OOP and the struct with Arrays and all the other recent patches and such.
Possible Solutions
I've seen this ondrej/ppa repository, which I refuse to use, given the fact that it may work, but it's an unknown/untrusted source. ALso, i'm not learning how to administer from source, using configure, make and install accordingly.
I've seen a solution compiling from source, which is essentially how I was hoping to go about it with some guidance.
Conclusion
So I didn't just expect to be spoon-fed, and I went out and did some manual reading and atleast started the ball rolling myself; this how far i've got.
The first thing I did was su into root (to save the typing sudo all the darn time).
$ sudo su
The next thing I did was download the latest version of php (5.4.7) and extracted it's contents ready to configure before installing it.
$ mkdir php5-new && cd !$
$ wget -O php-5.4.7.tar.bz2 http://php.net/get/php-5.4.7.tar.bz2/from/uk3.php.net/mirror
$ bzip2 -d php-5.4.7.tar.bz2
$ tar xvf php-5.4.7.tar.gz
$ cd php-5.4.7
$ ./configure --help
Finally I decided to have a bash, I looked through the list of options and decided I needed to list ALL of the things I wanted to include in the configuration.
$ ./configure --with-mysql --with-apache2 --with-libxml --with-openssl --with-zlib --with-bz2 --with-curl --with-dom --with-gd --with-imap --with-imap-ssl --with-mcrypt --with-mysqli --with-pdo-mysql --with-libxml --enable-ftp --enable-mbstring --enable-soap
Finally, the results...
When the configuration process had finished, it threw an error:
configure: error: xml2-config not found. Please check your libxml2 installation.