Share Ubuntu Server Clean Environment installation php5.3.10+mysql5.5.20+apache2.2.22 (end) Solution ideas

Source: Internet
Author: User
Share Ubuntu Server Clean Environment installation php5.3.10+mysql5.5.20+apache2.2.22 (end)
PHP recently out of a few major security risks, after familiar with Yum and apt-get install these lazy installation mode, gradually forget the previous configuration and compilation environment things, yesterday because Changjay classmate said can provide some installation process, looked at our plate this aspect of the article also less, It took an afternoon and a night to finally put the bare metal (only the system Ubuntu Server 11.10) on the latest PHP Apache MySQL which used the various extension modules are all the latest version.
Because it is bare metal needs to install a variety of missing components, in fact, if you are familiar with your system (the location of the previous installation module is very clear), just to upgrade PHP, the smooth one-time not more than half an hour (in fact, the time is up to 10 minutes). The rest of the time is spent downloading, looking for a compressed package, and reconfiguring the configuration incorrectly. One of the files there is a bug in the gcc-4.6.1 syntax error under strict inspection errors, according to the error prompts, modify the C file after the successful compilation.

Note: The # symbol in this article represents the operation prompt under root permissions, #号后跟指令



Just say upgrade installation, because install upgrade new version only need to recompile a new version, you need to upgrade the installed modules, and the location of the installation to the record, you can use echo phpinfo (), to see what the previous version installed extensions.
Download the latest version of PHP
http://www.php.net/downloads.php

The files I downloaded are
Php-5.3.10.tar.gz

#tar-ZXF php-5.3.10.tar.gz
#cd php-5.3.10
#./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--with-mysql=/opt/mysql/server-5.5/- -with-curl=/usr/local/curl--enable-ftp--with-libxml-dir=/usr/local/libxml2--with-expat-dir=/usr/lib-- Enable-soap--with-xsl=/usr/local/libxslt--enable-xslt--with-gd=/usr/local/gd2/--with-jpeg-dir=/usr/local/jpeg8 /--with-zlib-dir=/usr/lib--with-png-dir=/usr/lib--with-freetype-dir=/usr/local/freetype

If you copy this should not be possible, because unless you install the path and all modules are consistent, so you can refer to my configuration to modify it yourself, one is the path location, and the other is a number of unwanted extensions.

Here is a little explanation of the meaning of the configuration parameters.
--prefix= This is where the installation is set up.
--with-followed by the module module is followed by = is the module has been compiled and installed path


#make; make install

If successful, compile and install, because the configuration files already exist, and do not need to be modified, unless the upgrade from a very old version of the parameters need to be changed.

====================

The following is the bare metal installation of the entire environment process, may have forgotten, I slowly recalled, the process is complete.

1. Installing Apache
Relatively simple, no need for too many configurations
Download the latest stable version

#wget http://mirror.bjtu.edu.cn/apache//httpd/httpd-2.2.22.tar.bz2
#tar-ZXF httpd-2.2.22.tar.bz2
#cd httpd-2.2.22
#./configure--prefix=/usr/local/apache--enable-modules=so--enable-rewrite
# Make;make Install

If you do not have wget installed, you need to first install the wget tool.
#apt-get Install wget
In fact I seldom use wget, of course, incidentally recommend ARIA2
#apt-get Install Aria2

How to use
#aria2c-T X http://xxxxx
X is the number of threads, automatically support the breakpoint relay, in case something goes out, shut down the computer, the next time you continue to use this command he will automatically start from the last interrupt position.


If there is a bare-metal installation like me, there may be a lack of some environment error hints, find out what to load, the hint that GCC does not exist so apt-get install GCC
These compilation environments I use Apt-get directly. It's going to be too much time-consuming to compile it yourself.

Once installed, you do not need to start Apache for the time being. Because we have a lot of work to do.

2. Install PHP and a variety of libraries to use
If you are upgrading PHP, you generally do not need to toss this step. The general library is easy to solve, but also encountered more troublesome, such as the GD library.

A. Install GD library-let PHP support Gif,png,jpeg format
The GD library requires the support of the following modules
Jpeg8,libpng,freetype

The first is Jepg8 (most of the web uses the JEPG6 version, this is the latest module)
#aria2ch-T 3 ttp://www.ijg.org/files/jpegsrc.v8d.tar.gz
#tar-ZXF jpegsrc.v8d.tar.gz
#cd jpeg-8d
#./configure--prefix=/usr/local/jpeg8/--enable-shared--enable-static
#make; make install

Followed by libpng
Http://sourceforge.net/projects/libpng/files/libpng16/1.6.0beta10/libpng-1.6.0beta10.tar.gz/download
Use the browser to open the address download (most of the internet is the old 1.2x version, here is the latest module)

#tar-ZXF libpng-1.6.0beta10.tar.gz
#cd libpng-1.6.0beta10
#cp./SCRIPTS/MAKEFILE.STD Makefile
Note that there is no need to configure this, just copy the files.
#make; Make install

And finally the FreeType.
# wget HTTP://CDNETWORKS-KR-1.DL.SOURCEFORGE.NET/PROJECT/FREETYPE/FREETYPE2/2.4.8/FREETYPE-2.4.8.TAR.BZ2
This is the latest version.
#bzip2-D freetype-2.4.8.tar.bz2
#tar-XVF Freetype-2.4.8.tar
#cd freetype-2.4.8
#./configure--prefix=/usr/local/freetype
#make; Make install

Now the three modules needed are already compiled,
Formally start installation of GD library

#wget https://bitbucket.org/pierrejoye/gd-libgd/get/GD_2_0_34RC1.tar.gz
This is the latest version.

#tar-ZXF GD_2_0_34RC1.tar.gz
#cd pierrejoye-gd-libgd-5551f61978e3/src/
#./configure--prefix=/usr/local/gd2--with-jpeg=/usr/local/jpeg8/--with-png--with-zlib--with-freetype=/usr/ local/freetype/
#make; Make install

B. Installing the Curl Library
This is the latest version of Curl
#wget http://curl.haxx.se/download/curl-7.24.0.tar.gz
#tar-ZXF curl-7.24.0.tar.gz
#cd curl-7.24.0
#./configure--prefix=/usr/local/curl
#make; Make install

3. Install PHP

We have to solve libxml2 and libxslt before we install PHP.

A.libxml2
This is also the latest version
#wget http://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.30.tar.gz
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.